i installed ruby 1.9.2 with RVM, but when i type "ruby -v" is telling me the ruby v i have is 1.8.7 (mac)
when i write in the treminal "rvm list" i get this:
rvm rubies
ruby-1.9.1-p378 [ x86_64 ]
ruby-1.9.2-p136 [ x86_64 ]
but when i type "ruby -v" i get this:
ruby 1.8.7 (2009-06-12 patch开发者_开发技巧level 174) [universal-darwin10.0]
what shoud i do?
Have you tried rvm use 1.9.2
? Installing rubies does not make them the executable version of ruby. RVM will only make ruby
the 1.9.2 version if you tell it to, with rvm use 1.9.2
or rvm use 1.9.1
If you want rvm to use 1.9.2 by default, use rvm --default use 1.9.2
Without actually looking at your system, I can't say for sure what is happening, but it would appear that you skipped the RVM Post Install step (see RVM Install page, which is what loads it into your shell session.
Quoting from the RVM Install page:
Post Install
The first time you install RVM, you must put the following line into your ~/.bash_profile at the very end, after all path loads etc:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && ."$HOME/.rvm/scripts/rvm"
This loads RVM into a shell session.
NOTE: If you are using zsh you likely instead should put the sourcing line into ~/.zshrc
Doing so ensures rvm is loaded as a function (versus as a binary), ensuring commands such as rvm use work as expected.
An additional point:
Ensure that rvm is the last thing sourced in all of your shell profiles - e.g. it is sourced in the user specific profile after any environment variables, especially PATH are set. Otherwise, the values you set be trampled when you switch rubies.
精彩评论