Skip to content

Instantly share code, notes, and snippets.

@brenogazzola
Forked from fijimunkii/rbenv_uninstall_gems.sh
Created October 17, 2022 17:44
Show Gist options
  • Save brenogazzola/6bd3031f0d72631ad2c2278dda7fb789 to your computer and use it in GitHub Desktop.
Save brenogazzola/6bd3031f0d72631ad2c2278dda7fb789 to your computer and use it in GitHub Desktop.
rbenv: uninstall all 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment