views:

293

answers:

3

If I do sudo gem uninstall rails -v 3.0.0.beta3, it uninstalls rails but leaves the beta3 versions of activerecord, actionmailer, etc. How do I completely uninstall rails 3.0.0.beta3 and all its dependencies automatically? I would like a clean slate for the RC and final releases.

A: 

you can't do it automatically unless you write your own script wrapper around the gem uninstall command

just manually do gem uninstall on the other files like activerecord, activesupport, etc...

cpjolicoeur
+1  A: 
$ gem list
...
$ sudo gem uninstall {gem-you-don't-want} {version-you-don't-want}
$ {rinse-and-repeat}
Justice
well sure, if you want to do it the hard way! i was hoping dependencies also worked for UNinstall :)
Mark Richman
@Mark Richman: RubyGems doesn't track which gems were installed manually and which ones were installed automatically as dependencies. Therefore, it simply *cannot* know which ones are still needed.
Jörg W Mittag
+1  A: 

If your situation is that you have installed beta 4 and want to get rid of beta 3, you can simply run

gem cleanup

which removes all but the latest version of all your gems (wiping out beta 3 and leaving you with beta 4).

thorncp
I guess I should RTFM :)
Mark Richman