Shorthand to clean up installed Rubygems (but don’t cleanup Rails)

I trimmed my installed Rubygems on my local development machine. The command “

sudo gem cleanup

” is just for that.

Only problem: What about my older Rails apps that require a specific version of Rails, ActiveRecord, etc.?

My solution:

gem list –no-versions | grep -v “^active” | grep -v “^action” | grep -v “^rails$” | xargs sudo gem cleanup {}

Any suggestions on how to make it even simpler?

Comments are closed.