Cleanup old Gems, but not rails and friends
If you’re like me and have several rails applications in different rails versions, it’s difficult to just run a gem cleanup, because it would mean all your old rails gems will also be deleted.
You don’t want that, but you also don’t want to clean them up one by one.
Here’s easy way to do it from your bash command line:
for g in $(sudo gem cleanup --dryrun \
| awk '$1=="Dry" && $6!~/^(rails|action(mailer|webservice|pack)|active(resource|support|record))/ { print $6}' \
| sed -E -e 's/-([0123456789].?)+$//g' \
| sort --unique --ignore-case); do
sudo gem cleanup $g
doneJust copy the code above in your terminal, make sure you’ve got sudo rights.
You might get warnings about dependencies, just say no and rerun the code if needed.
Trackbacks
Use the following link to trackback from your own site:
http://blog.larik.nl/trackbacks?article_id=10342