简体   繁体   中英

Ruby version did not get updated to 1.9.x

I installed ruby as per instructions given here but when I do ruby--version then it still shows 1.8.7. How do I make sure I use newly installed Ruby?

I would suggest you to use RVM (Ruby Version Manager). You may find a full installation guide here:

http://ryanbigg.com/2011/06/mac-os-x-ruby-rvm-rails-and-you/

If you get an error such as "ERROR: Error running ' ./configure...." after executing rvm install eg

rvm install 1.9.3

Then you may try to install it like this:

rvm install 1.9.3 --with-gcc=clang

Note: in the guide this possible error is not described

Did you properly setup your PATH ? What's the output of echo $PATH ? /usr/local/bin has to come first they way this tutorial sets up things. You see that everything worked right when which ruby displays /usr/local/bin/ruby .

Personally I'd recommend using a tool for managing Ruby versions though. RVM still seems to be the most popular choice, I prefer the combination of rbenv and ruby-build .

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