迁移到 Snow Leopard 搞乱了我的红宝石之路

发布于 2024-09-29 14:43:31 字数 906 浏览 1 评论 0原文

自从我从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

永言不败 2024-10-06 14:43:31

安装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

沉睡月亮 2024-10-06 14:43:31

最后两行 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文