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?

2 Responses to “Shorthand to clean up installed Rubygems (but don’t cleanup Rails)”

  1. Tom Faulkner Says:

    No suggestions – I’ve been looking for this solution for quite a while. Thanks! :) (I hope I’ll be more helpful someday:P)