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

**URL:** <https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772>\
**Category:** Rails\
**Created:** [September 17, 2008, 12:07am UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772 "2008-09-17T00:07:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 17, 2008, 12:07am UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/1 "2008-09-17T00:07:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 17, 2008, 1:56am UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/2 "2008-09-17T01:56:16Z")

</div>

On Tue, Sep 16, 2008 at 3:06 PM, jfrankov [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> $ gem search --local rubygem  
> $ 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

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 17, 2008, 2:21am UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/3 "2008-09-17T02:21:59Z")

</div>

On Sep 16, 4:55 pm, “Conrad T.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > $ 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.

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 17, 2008, 2:30am UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/4 "2008-09-17T02:30:45Z")

</div>

Hey, please try to do the following:  
sudo gem clean

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 17, 2008, 5:36am UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/5 "2008-09-17T05:36:47Z")

</div>

On 17 Sep 2008, at 01:21, jfrankov [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Rails requires RubyGems \>= 0.9.4 (you have 0.9.3). Please `gem  
> > > Tue Sep 16 14:51:38 [~/Seethroo/working/code/ror/trunk]  
> > > 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

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 21, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/6 "2008-09-21T21:14:33Z")

</div>

On 21 Sep 2008, at 19:47, jfrankov wrote:

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

What’s the output of  
which gem  
which spec  
?

Fred

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 21, 2008, 8:48pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/7 "2008-09-21T20:48:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 21, 2008, 9:37pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/8 "2008-09-21T21:37:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jfrankov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Post date:** [September 21, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772/9 "2008-09-21T22:32:31Z")

</div>

On 21 Sep 2008, at 20:36, jfrankov [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> jfrankov@bigmac (540) $ locate ruby | egrep “spec$” | grep bin  
> /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
