問題:
I installed rbenv according to the github directions.我根據github的說明安裝了rbenv。 I am running OSX but I have tried this on a Ubuntu 12.04 VM and got the same results.我正在運行 OSX,但我已經在 Ubuntu 12.04 VM 上嘗試過,並得到了相同的結果。 The following is what i get in my terminal when I try to change ruby versions:以下是我嘗試更改 ruby 版本時在終端中得到的信息:
rbenv versions
* 1.9.3-p0 (set by /Users/user/.rbenv/version)
1.9.3-p125
rbenv global
1.9.3-p0
rbenv rehash
ruby -v
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]
which ruby
/usr/bin/ruby
Anyone have any ideas as to why rbenv isn't switching the ruby version like it thinks it is?任何人都知道爲什麼 rbenv 沒有像它認爲的那樣切換 ruby 版本? Also there is no .rbenv file in the local directory that would be causing the ruby version to default to 1.8.7本地目錄中也沒有 .rbenv 文件會導致 ruby 版本默認爲 1.8.7
rbenv local
rbenv: no local version configured for this directory
解決方案:
參考一: https://stackoom.com/question/juBU參考二: rbenv not changing ruby version