Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again (I have rubygems 1.3.6!)
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. Ple开发者_开发技巧ase install RubyGems and try again:http://rubygems.rubyforge.org
any ideas how to fix this?
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
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
I just ran into this issue today, and for those of you who do something similar to what I did here is the fix and a little background.
I was installing some dependencies for rmagik, took the easy way out and used macports, it automatically went ahead and updated my default ruby to /opt/... so rubygems went missing since it only intalled ruby.
my advise, use rvm (http://rvm.beginrescueend.com/) like raphael_turtle says, since you will want RVM to be in charge of updating your links to ruby, rubygems and rails.
*Be wary when installing via macports or brew, just make sure you see what else is being installed, and don't accidently overwrite your local configs.
I had the same problem. My installation was done for me by technical support, so it was not me who did the installation (security problems).
The problem was that I didn't have some access rights, so this helped:
sudo - su user_name_with_enough_access_rights
And then run scripts/server again.
I couldn't figure out what was wrong so I installed rvm with a new version of rails and ruby.
精彩评论