Skip to content

Instantly share code, notes, and snippets.

@kugaevsky
Last active November 15, 2017 16:49
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kugaevsky/5830602 to your computer and use it in GitHub Desktop.
Save kugaevsky/5830602 to your computer and use it in GitHub Desktop.
Cleanup outdated gems from all your rvm gemsets
#!/bin/sh
echo "NB! This process could be too destructive sometimes and you may need to run 'bundle' command from your project directory."
echo "Do you want to cleanup all gemsets?"
read -p "(anything other than 'yes' will cancel) > " ANSWER
if [[ $ANSWER != "yes" ]]
then
echo "Phew...\nMay be another day."
else
for gemset in `ls $rvm_path/gems | grep @`
do
echo "Switching to gemset $gemset"
rvm $gemset do gem cleanup
done
echo "\nAll gemsets are clean and shiny!"
fi
exit 0
@ojab
Copy link

ojab commented Aug 23, 2017

rvm all-gemsets do gem cleanup?

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