Rubygems 1.3.5 thinks it's 1.3.1

I upgraded to Rails to 2.3.4, and now some things aren't working in a freshly created Rails project. For example:

$ script/plugin -l Rails requires RubyGems >= 1.3.2 (you have 1.3.1). Please `gem update --system` and try again.

So I'm trying to update rubygems (in a user directory; I don't have sudo access). But the gem binary I download from RubyForge thinks that it's version 1.3.1:

$ wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz $ tar vxzf rubygems-1.3.5.tgz $ cd rubygems-1.3.5/ $ ./bin/gem --version 1.3.1

Has anyone seen this before?

That is because you have more than one Ruby installation and when you installed your RubyGems 1.3.5 it was not installed in the global Ruby install and rather your local install.

Try running a few which gem and which ruby commands to hunt down the issue. You might also have to look at your path to figure this out.

Just as an example on one of my servers I have the normal /usr/local/ bin/ruby install but I also have /opt/ruby-enterprise/bin/ruby which is what I use and I have to make sure this is in the front of my path or else I might install a gem under the wrong directory...

This does the trick: export PATH=/opt/ruby-enterprise/bin:$PATH