在运行 Snow Leopard 10.6.5 的 Mac OS 上升级 Ruby 安装
我有一个运行 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
因此,为了升级我的安装,我首先安装了 macports,然后使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
已解决:
编辑主目录中的“.profile”文件:
在底部添加行:
然后在终端中运行
以设置更改。
SOLVED:
Edit the '.profile' file in home directory:
Add the line at the bottom:
and then in the Terminal run
to set the changes.
您是否按照 RVM 安装页面中的“安装后”说明操作,并将以下行添加到你的 ~/.bashrc、~/.bash_profile 或 ~/.profile 文件之一?
这对于让 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?
That's really important to get RVM working correctly.