# "Gem::RubyGemsVersion" and gem -v don't match

**URL:** <https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641>\
**Category:** Rails\
**Created:** [January 14, 2009, 12:18am UTC](https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641 "2009-01-14T00:18:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rredcat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@rredcat](https://www.ruby-forum.com/u/rredcat)\
**Post date:** [January 14, 2009, 12:18am UTC](https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641/1 "2009-01-14T00:18:38Z")

</div>

Hello,

1. gem -v shows next: “1.3.1”
2. my ruby&rails project has boot.rb file it contains next method  
def rubygems\_version  
Gem::RubyGemsVersion rescue nil  
end  
this method is called in next code:  
def load\_rubygems  
require ‘rubygems’  
min\_version = ‘1.3.1’  
unless rubygems\_version \>= min\_version  
$stderr.puts %Q(Rails requires RubyGems \>= #{min\_version} (you  
have #{rubygems\_version}). Please `gem update --system` and try again.)  
exit 1  
end

Sometime when I open my project I have a window with next text “Rails  
requires RubyGems \>= 1.3.1 (you have 1.2.0). Please `gem update --system` and try again.”

Why Gem::RubyGemsVersion rescue nil gets “1.2.0” when I have “1.3.1”  
version?? Any idea?

PS: This trouble doesn’t have any affect to work of project, but I  
interest how(where) can I fix it?  
PSS: start “gem update --system” says “Nothing to update”  
PSSS: I’m novice in Ruby so please, expand your answer (:

---

<div class="post-metadata">

**Author:** ![rredcat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@rredcat](https://www.ruby-forum.com/u/rredcat)\
**Post date:** [January 14, 2009, 1:24am UTC](https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641/2 "2009-01-14T01:24:05Z")

</div>

On 13 Jan 2009, at 23:18, Rred C. wrote:

> Hello,

Do you have more than one install of ruby (eg one in /usr/bin, the  
other in /usr/local/bin ?)

Fred

---

<div class="post-metadata">

**Author:** ![rredcat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@rredcat](https://www.ruby-forum.com/u/rredcat)\
**Post date:** [January 14, 2009, 8:23am UTC](https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641/3 "2009-01-14T08:23:14Z")

</div>

Frederick C. wrote:

> On 13 Jan 2009, at 23:18, Rred C. wrote:
> 
> > Hello,
> 
> Do you have more than one install of ruby (eg one in /usr/bin, the  
> other in /usr/local/bin ?)
> 
> Fred

Hello Fred,  
I think that was not present.  
link (Ruby) and executable (Ruby1.8) was presented in /usr/bin, but  
/usr/local/bin is empty.

---

<div class="post-metadata">

**Author:** ![rredcat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@rredcat](https://www.ruby-forum.com/u/rredcat)\
**Post date:** [January 14, 2009, 8:57am UTC](https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641/4 "2009-01-14T08:57:31Z")

</div>

try installing the gem “rubygems-update” and then call “sudo  
update\_gems”.

---

<div class="post-metadata">

**Author:** ![rredcat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@rredcat](https://www.ruby-forum.com/u/rredcat)\
**Post date:** [January 14, 2009, 8:59pm UTC](https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641/5 "2009-01-14T20:59:33Z")

</div>

I had something similar, check your installations and paths…

Cheers, Sazima

---

<div class="post-metadata">

**Author:** ![rredcat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@rredcat](https://www.ruby-forum.com/u/rredcat)\
**Post date:** [January 14, 2009, 9:07pm UTC](https://www.ruby-forum.com/t/gem-rubygemsversion-and-gem-v-dont-match/157641/6 "2009-01-14T21:07:49Z")

</div>

On Jan 14, 7:23 am, Rred C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello Fred,  
> I think that was not present.  
> link (Ruby) and executable (Ruby1.8) was presented in /usr/bin, but  
> /usr/local/bin is empty.

They could be in other places - those were just examples. Comparing  
the output of  
which gem  
and  
which ruby

might be enlightening.

Fred
