Created
June 9, 2012 20:37
-
-
Save IanVaughan/2902499 to your computer and use it in GitHub Desktop.
Uninstall all rbenv gems
This file contains 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 bash | |
uninstall() { | |
list=`gem list --no-versions` | |
for gem in $list; do | |
gem uninstall $gem -aIx | |
done | |
gem list | |
gem install bundler | |
} | |
#rbenv versions --bare | |
RBENVPATH=`rbenv root` | |
echo $RBENVPATH | |
RUBIES=`ls $RBENVPATH/versions` | |
for ruby in $RUBIES; do | |
echo '---------------------------------------' | |
echo $ruby | |
rbenv local $ruby | |
uninstall | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated solution needed, because of the following header:
Fix:
--no-verbose
is what removes the header.(We may need another fix in the future if things change again)
I don't include
gem install bundler
at the end.Many times in Rails, Gemfile.lock will include a specific bundler version, so I prefer to just install that version manually.