views:

76

answers:

2

Since I've migrated from Leopard to Snow Leopard I get

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

the only way to make it work is:

$ /usr/bin/ruby script/server
=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000

So I guess something got broken with my path, here is my ~/.profile file fyi:


##
# DELUXE-USR-LOCAL-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "/usr/local/bin"
if [ $? -eq 1 ] ; then
    PATH=$PATH:/usr/local/bin
    export PATH
fi

export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info

PATH="/usr/local/mysql/bin:$PATH"
PATH="/opt/local/bin:/opt/local/sbin:$PATH"
PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export PATH

export GEMDIR=`gem env gemdir`

If you want to see me smiling again please share your priceless knowledge with me.

Thanks.

+4  A: 

install RVM http://rvm.beginrescueend.com/

Problem solved..

Doon
This is indeed the most hassle-free solution!
Mark Thomas
Not only the most hassle-free solution, but it also allows you to use multiple rubies at once (e.g. 1.8.7, 1.9.2 and jruby).
Ariejan
A: 

The last two PATH= lines appear to be the problem. There's a Ruby in your /usr/local/bin or /opt/local/bin directory and it's taking precedence over the system-installed one. I'm not sure why migrating to Snow Leopard would trigger this, since I don't believe it adds those lines to the file.

Doon's recommendation of RVM is not necessary, but it is a really handy tool.

Chuck
My guess is that pre snow leopard, OP had upgraded system ruby using gem update --system. Upgrade to snow leopard replaces the system ruby. My guess is gem path and the like are getting all messed up due the /usr/bin/rails file calling the ruby in system frameworks. When I upgraded to snow leopard I did a clean install and then migrated all my data over, rebuilt the dev environment (This was pre -rvm) now that I am using RVM. I leave the system ruby alone.
Doon