迁移到 Snow Leopard 搞乱了我的红宝石之路
自从我从 Leopard 迁移到 Snow Leopard 后,我得到的
$ ruby script/server
Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org
唯一方法是:
$ /usr/bin/ruby script/server
=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
所以我猜我的路径出了问题,这是我的 ~/.profile 文件 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`
我该如何解决这个问题?
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`
How can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
安装RVM http://rvm.io/
问题解决了..
还有许多其他类似的软件:https://github.com/wayneeseguin/rvm/blob/master/help/alt。 MD
install RVM http://rvm.io/
Problem solved..
There is also number of other similar software: https://github.com/wayneeseguin/rvm/blob/master/help/alt.md
最后两行 PATH= 似乎是问题所在。您的
/usr/local/bin
或/opt/local/bin
目录中有一个 Ruby,它的优先级高于系统安装的。我不确定为什么迁移到 Snow Leopard 会触发此问题,因为我不相信它会将这些行添加到文件中。Doon 推荐的 RVM 并不是必需的,但它是一个非常方便的工具。
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.