Last active
December 19, 2015 04:19
-
-
Save cesarfigueroa/5896422 to your computer and use it in GitHub Desktop.
Uninstall all gems in Ruby 2.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
gems=`gem list --no-versions` | |
default_gems=(bigdecimal io-console json minitest psych rake rdoc test-unit) | |
for gem in $gems; do | |
if [[ ${default_gems[*]} != *$gem* ]]; then | |
gem uninstall $gem -aIx | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of version 2.1.0, you can simply do
gem uninstall -aIx
.