Created
June 25, 2022 11:20
-
-
Save ollietreend/141ec702c14882f0690ea99413d518da to your computer and use it in GitHub Desktop.
Uninstall all gems from all Ruby versions managed by rbenv
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 bash | |
# Uninstall all gems from all Ruby versions managed by rbenv | |
uninstall_gems() { | |
gems=$(gem list --no-versions) | |
for gem in $gems; do | |
gem uninstall $gem -aIx | |
done | |
gem list | |
gem install bundler | |
} | |
ruby_versions=$(rbenv versions --bare) | |
for version in $ruby_versions; do | |
echo '---------------------------------------' | |
echo $version | |
rbenv local $version | |
uninstall_gems | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment