在运行 Snow Leopard 10.6.5 的 Mac OS 上升级 Ruby 安装

发布于 2024-10-09 18:52:06 字数 966 浏览 0 评论 0原文

我有一个运行 Snow Leopard 10.6.5 的 Mac 操作系统,并且我正在尝试升级我的 Ruby 安装。

在执行任何操作之前,我运行以下命令并得到以下结果:

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

$ which ruby
/usr/bin/ruby

因此,为了升级我的安装,我首先安装了 ma​​cports,然后使用 Ruby 版本管理器 (RVM)。

1. bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)
2. mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install
3. rvm install 1.9.2
4. rvm 1.9.2 --default

之后,我运行以下命令,得到以下结果:

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

$ which ruby
/usr/bin/ruby

$ rvm list
=> ruby-1.9.2-p136 [ x86_64 ]

为什么 Ruby 仍然是 1.8.7?怎么了?或者,我忘记了什么?

I have a Mac Os running Snow Leopard 10.6.5 and I am trying to upgrade my Ruby installation.

Before I did anything, I run the following commands and I had the following results:

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

$ which ruby
/usr/bin/ruby

So, to upgrade my installation, I installed first macports and then Ruby using Ruby Version Manager (RVM).

1. bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)
2. mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install
3. rvm install 1.9.2
4. rvm 1.9.2 --default

After that, I run the following commands and I had the following results:

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

$ which ruby
/usr/bin/ruby

$ rvm list
=> ruby-1.9.2-p136 [ x86_64 ]

Why Ruby is still at 1.8.7? What is wrong? Or, what I forgot?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

我家小可爱 2024-10-16 18:52:06

已解决:

编辑主目录中的“.profile”文件:

在底部添加行:

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

然后在终端中运行

source ~/.profile

以设置更改。

SOLVED:

Edit the '.profile' file in home directory:

Add the line at the bottom:

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

and then in the Terminal run

source ~/.profile

to set the changes.

心在旅行 2024-10-16 18:52:06

您是否按照 RVM 安装页面中的“安装后”说明操作,并将以下行添加到你的 ~/.bashrc、~/.bash_profile 或 ~/.profile 文件之一?

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

这对于让 RVM 正常工作非常重要。

Did you follow the "Post Install" instructions in the RVM installation page and add the following line to one of your ~/.bashrc, ~/.bash_profile or ~/.profile files?

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

That's really important to get RVM working correctly.

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