views:

796

answers:

2

I like that Rails 3 is so easy to install: gem install rails --pre, and all of the dependencies are automatically installed for you. But, what about uninstalling it? If I just do gem uninstall rails, I still have

actionmailer (3.0.0.beta3)
actionpack (3.0.0.beta3)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3)
activeresource (3.0.0.beta3)
activesupport (3.0.0.beta3)

which I want to get rid of. What's the easiest way to do so?

A: 

Check your currently installed version(s):

gem list -d rails

Then uninstall the version(s) you don't want:

sudo gem uninstall rails -v 3.0.0.beta3
sudo gem uninstall actionmailer -v 3.0.0.beta3

etc.

I'm still trying to figure out how to completely remove rails 3.0.0.beta3 and all its deps.

Mark Richman
OK, I realize that I could do that; what I was really wondering is, isn't there a way that requires a single command? Like a single `gem` command that means "uninstall everything where the version number is exactly 3.0.0.beta3"?
Trevor Burnham
+1  A: 

if you're planning to upgrade to a newer version of rails, you can do:

sudo gem clean

after newer version has been installed, this uninstall All older versions of your gems leaving only the latest version in your system.

sai
Thanks, that'll do nicely. It'd be nice if `gem clean` could take a version number as an argument, so I could remove all of the `3.0.0.beta3` stuff in one stroke, but obliterating all old versions is good enough for me.
Trevor Burnham