views:

957

answers:

3

I'm running rails version 2.3.5 and rubygems version 1.3.6, when I script/server I get this error

Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again:http://rubygems.rubyforge.org

any ideas how to fix this?

+1  A: 

Maybe it’s not finding your correct gem path. I’ve had similar problems related to that. You might need to update your bash prefs eg in .basrc you might have something like this:

GEMS=/home/me/ruby1.8/lib/ruby/gems/1.8/bin/ export PATH=$RUBY:$GEMS:$HOME/bin:$PATH:$NGINX:$MONIT:$GIT

Gordon Isnor
+2  A: 

The first thing you should do is run: gem env

This will output, amongst other things, the RUBYGEMS_VERSION and your GEM_PATHS. Verify that everything you think is true, is indeed true.

In the GEM_PATHS, you will probably see multiple paths, the top most being the primary path.

You can set GEM_HOME to the primary gem directory in the your .bash_login/etc file. Open a new terminal and run gem env again to make sure that it is being picked up.

As Gordon indicated, make sure these GEM paths are in your PATH.

Some other things to think about ownership/permissions. If you use sudo when working with gems on your system, they get installed in a different directory than when you install/update normally.

Perhaps you installed the rubygems using sudo, but rails is not running as root.

Read the installation notes if you still cannot figure it out: ruby gems installation

Matt Dressel
A: 

I couldn't figure out what was wrong so I installed rvm with a new version of rails and ruby.

raphael_turtle