Cleanup outdated gems from all your rvm gemsets
There is no day without useful gem release.
And if you prefer staying on the edge and run bundle update
command everyday, this small script can help you keep your gemsets free from old-versioned gems.
It runs across every gemset you have and executes gem cleanup
command.
#!/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
Written by Nick Kugaevsky
Related protips
1 Response
awesome, thanks!!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#