rspec, Rails 2.1.0, rubygems, Mac OS X Leopard - rubygems does not recognize latest version

I'm trying to run some specs on my Mac OS/Leopard machine (10.5.5) but
rubygems won't allow it:

$ spec spec/models/my_spec.rb
Rails requires RubyGems >= 0.9.4 (you have 0.9.3). Please `gem update
--system` and try again.

...but I already have the latest & greatest installed:

$ gem search --local rubygem

*** LOCAL GEMS ***

rubygems-update (1.2.0, 0.9.5)
Tue Sep 16 14:51:38 [~/Seethroo/working/code/ror/trunk]
jfrankov@bigmac (504) $ sudo gem update --system
Password:
Updating RubyGems
Nothing to update

$ spec spec/models/my_spec.rb
Rails requires RubyGems >= 0.9.4 (you have 0.9.3). Please `gem update
--system` and try again.

Any idea why this is "stuck"? I've tried to reinstall the gem using --
force but it doesn't make a difference.

Thanks for any advice-

-Jason

Please try to doing the following:

sudo gem update --system

Have a look at my original post - already did that to no effect.

Hey, please try to do the following:

sudo gem clean

Good luck,

-Conrad

I'm trying to run some specs on my Mac OS/Leopard machine (10.5.5)
but
rubygems won't allow it:

$ spec spec/models/my_spec.rb
Rails requires RubyGems >= 0.9.4 (you have 0.9.3). Please `gem
update
--system` and try again.

...but I already have the latest & greatest installed:

$ gem search --local rubygem

*** LOCAL GEMS ***

rubygems-update (1.2.0, 0.9.5)
Tue Sep 16 14:51:38 [~/Seethroo/working/code/ror/trunk]
jfrankov@bigmac (504) $ sudo gem update --system
Password:
Updating RubyGems
Nothing to update

$ spec spec/models/my_spec.rb
Rails requires RubyGems >= 0.9.4 (you have 0.9.3). Please `gem
update
--system` and try again.

Please try to doing the following:

sudo gem update --system

Have a look at my original post - already did that to no effect.

Do you have 2 ruby install? (ie one with an up to date rubygems and
then another one)? Do which gem and which spec report that they are in
the same place?

Fred

Good suggestion, but that didn't work either. Here's what I did:

503 sudo gem clean -V | tee gem_clean.txt
  504 gem list
  505 cd code/trunk/
  506 svn up
  507 svn info .
  508 ls
  509 spec ./spec/models/targeting_condition_spec.rb (failed)
  510 sudo gem update --system
  511 spec ./spec/models/targeting_condition_spec.rb (failed again)
  512 gem list RubyGems (shows rubygems-update (1.2.0))
  513 gem update rubygems-update
  514 spec ./spec/models/targeting_condition_spec.rb (failed again)

Every time the error is "Rails requires RubyGems >= 0.9.4 (you have
0.9.3). Please `gem update --system` and try again."

I just did notice something. The gem_clean.txt (output from the gem
clean command) has a lot of these errors in it:

Attempting to uninstall net-ssh-1.1.2
Unable to uninstall net-ssh-1.1.2:
        Gem::GemNotInHomeException: Gem is not installed in directory /
Library/Ruby/Gems/1.8

Maybe this means that the gem database is munged? Do I have to wipe
out every gem and install from scratch (argh)?

-Jason

Good suggestion, but that didn't work either. Here's what I did:

What's the output of
which gem
which spec
?

Fred

Looks like I do have two versions of ruby:

jfrankov@bigmac (536) $ /usr/local/bin/ruby -v
ruby 1.8.5 (2006-08-25) [i686-darwin8.9.1]
jfrankov@bigmac (537) $ /usr/bin/ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

One version of spec:

jfrankov@bigmac (540) $ locate ruby | egrep "spec$" | grep bin
/usr/local/lib/ruby/gems/1.8/gems/rspec-1.0.8/bin/spec

...and several versions of gem:

jfrankov@bigmac (557) $ locate ruby | egrep "gem$" | grep bin
/Library/Ruby/Gems/1.8/gems/rubygems-update-0.9.5/bin/gem
/Library/Ruby/Gems/1.8/gems/rubygems-update-1.2.0/bin/gem
/Users/jfrankov/src/rubygems-0.9.0/bin/gem
/usr/local/lib/ruby/gems/1.8/gems/newgem-0.14.1/bin/newgem
/usr/local/lib/ruby/gems/1.8/gems/rubygems-update-0.9.2/bin/gem
/usr/local/lib/ruby/gems/1.8/gems/rubygems-update-0.9.3/bin/gem

Looks to me that gem is installing the right version in /Library/Ruby/
Gems/1.8, but spec is looking at /usr/local/lib/ruby/gems/1.8. Should
i just blast /usr/local/lib/ruby/gems/1.8, or is that controlled by
some package manager?

-Jason

Looks like I do have two versions of ruby:

jfrankov@bigmac (536) $ /usr/local/bin/ruby -v
ruby 1.8.5 (2006-08-25) [i686-darwin8.9.1]
jfrankov@bigmac (537) $ /usr/bin/ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

One version of spec:

jfrankov@bigmac (540) $ locate ruby | egrep "spec$" | grep bin
/usr/local/lib/ruby/gems/1.8/gems/rspec-1.0.8/bin/spec

...and several versions of gem:

jfrankov@bigmac (557) $ locate ruby | egrep "gem$" | grep bin
/Library/Ruby/Gems/1.8/gems/rubygems-update-0.9.5/bin/gem
/Library/Ruby/Gems/1.8/gems/rubygems-update-1.2.0/bin/gem
/Users/jfrankov/src/rubygems-0.9.0/bin/gem
/usr/local/lib/ruby/gems/1.8/gems/newgem-0.14.1/bin/newgem
/usr/local/lib/ruby/gems/1.8/gems/rubygems-update-0.9.2/bin/gem
/usr/local/lib/ruby/gems/1.8/gems/rubygems-update-0.9.3/bin/gem

Looks to me that gem is installing the right version in /Library/Ruby/
Gems/1.8, but spec is looking at /usr/local/lib/ruby/gems/1.8. Should
i just blast /usr/local/lib/ruby/gems/1.8, or is that controlled by
some package manager?

/usr/local/... Is stuff you've installed yourself. Getting rid of that
ruby install and installing everything in the remaining one would
certainly be one way forward (but make sure you get rid of all of it -
not just the gems)

The ruby in /Library belongs to the system. I wouldn't touch that one

Fred