Skip to content

Instantly share code, notes, and snippets.

@bdthinh
Forked from IanVaughan/uninstall_gems.sh
Created September 6, 2016 06:46
Show Gist options
  • Save bdthinh/fa64aaaf543b2a50cb433bd961ae6ee7 to your computer and use it in GitHub Desktop.
Save bdthinh/fa64aaaf543b2a50cb433bd961ae6ee7 to your computer and use it in GitHub Desktop.
Uninstall all rbenv gems
#!/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
@bdthinh
Copy link
Author

bdthinh commented Sep 6, 2016

Love this :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment