Skip to content

Instantly share code, notes, and snippets.

@wellington1993
Forked from IanVaughan/uninstall_gems.sh
Last active March 23, 2016 18:06
Show Gist options
  • Save wellington1993/6ab3fb182423f577f48e to your computer and use it in GitHub Desktop.
Save wellington1993/6ab3fb182423f577f48e to your computer and use it in GitHub Desktop.
Uninstall all rbenv gems
#!/usr/bin/env zsh
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