简体   繁体   中英

Ruby 1.9.3 with rvm on Mac Lion installs, but doesn't show up in Ruby or irb

On Mac OS X running Lion 10.7.3 and having Xcode 4.3.2, I find that installing ruby 1.9.3 through rvm and setting default to use 1.9.3 still shows ruby -v to be 1.8.7 (irb RUBY_VERSION also shows 1.8.7).

$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
$ rvm install 1.9.3 --with-gcc=clang
<installs successfully>
$ rvm --default 1.9.3
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
$ irb
>> RUBY_VERSION
=> "1.8.7"

How do I get ruby and irb to use ruby 1.9.3 on this configuration?

Update: Looks like I had an older version of rvm. I installed Jewelry Box (OS X rvm GUI tool), which reinstalled rvm, and then updated the ruby to use from within jewelry box. This did the trick. Thanks all for your help.

Thanks

If you have successfully installed ruby 1.9.3

then you can check it by this command either installed or not

     rvm list

then all rubies listing will be display...

then if you select any rubu version use this command

 rvm use ruby-1.9.3  --default

and enjoying.........

I had a similar issue and wanted to post my solution as it may be helpful for someone. I switched to 1.9.3 in my terminal window and then opened another window to use IRB in that window. When I did

RUBY_VERSION

in IRB it told me I was using 1.8.7. I realized after that I shouldn't have opened another window to do it. It works just fine if I stay in the same window, make sure I am using 1.9.3 and then go into IRB from there.

Thought someone else might have a use case like mine and this would help.

rvm get head will update your RVM installation in place to the current release. It's a good idea to do that periodically, just to keep up with the bug fixes and new features.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM