One liner to remove installed gems, excluding default gems
This is a one liner that will remove installed gems that are not default.
gem list | awk '{print $1}' | grep -Ev 'bundle|test-unit|rdoc|psych|io-console|minitest|rake|bigdecimal|json' | xargs gem uninstall -Iax
The grep -Ev
part will list all gems excluding the ones mentioned.
If you know of any more default gems, you can add it to the pattern separated by a pipe.
Written by Kaustubh Padegaonkar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#