How could I uninstall the build-in gems in Leopard

I am a newbie on the Mac and ROR. I am trying to install the rails on
my Leopard today and get its done. But I found for many of the gems,
there are tow versions installed on my machine. There is a lower
version installed at /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8 and an updated version I installed
today at /Library/Ruby/Gems/1.8

For example,

stanley$ gem list -d rake -a

*** LOCAL GEMS ***

rake (0.8.3, 0.7.3)
    Author: Jim Weirich
    Installed at (0.8.3): /Library/Ruby/Gems/1.8
                 (0.7.3): /System/Library/Frameworks/Ruby.framework/

And if I run rake -V, it will tell me that the current version
executed is 0.8.3.

But if I tried to cleanup the old version installed on my machine, if
failed, as the following:

stanley$ sudo gem cleanup rake
Cleaning up installed gems...
:0:Warning: Gem::SourceIndex#search support for Regexp patterns is
Attempting to uninstall rake-0.7.3
ERROR: While executing gem ... (Gem::InstallError)
    Unknown gem rake = 0.7.3

I am wondering how could I uninstall the old version of these gems?

And another question is that I checked the rake file executed which
is /usr/bin/rake
I didn't find any information or path set there that told the console
which rake it should call? If I wanna to use an old version of rake or
even rails, how should I do?


To be honest, I wouldn't bother. If it's in /System, leaving it alone
is generally a good idea. It doesn't do any harm having multiple
versions of gems installed. The executables gem installs try and load
the most recent version of the associated gem. You can force a
particular one, eg

rake _0.7.3_

runs that version of rake.


On our setups, we simply use the built-in mac stuff and then update the old versions.

gem update --system
gem install rails

You can safely ignore the old versions without a problem.

Thanks for both of you. It looks like the simple way is ignoring it...

Thanks for the tip Brian, I am trying it out now. I did a 'gem update
rails' and it started to cough up the following:

michael@Mac-Pro:~/Desktop/rails_demo$ rails blog
1.8/rubygems.rb:379:in `report_activate_error': RubyGem version error:
rake(0.7.3 not >= 0.8.3) (Gem::LoadError)

Will report after trying this. Thanks :slight_smile:


It works!! Thanks :slight_smile: