开发者

Upgrading Ruby installation on Mac OS running Snow Leopard 10.6.5

开发者 https://www.devze.com 2023-02-01 14:34 出处:网络
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:

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/ && c开发者_运维百科d ~/.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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消