2013-02-20 164 views
0

這裏是我已經運行的命令,以rbenv安裝紅寶石1.9.3-P0但我每次運行的命令列表ruby --version我得到1.8.23 。我不確定這是爲什麼?試圖安裝紅寶石1.9.3與rbenv,但不斷得到紅寶石1.8

Anderss-MacBook-Pro:anchor anderskitson$ ruby --version 
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] 
Anderss-MacBook-Pro:anchor anderskitson$ rbenv install 1.9.3-p0 
Downloading yaml-0.1.4.tar.gz... 
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b 
Installing yaml-0.1.4... 
Installed yaml-0.1.4 to /Users/anderskitson/.rbenv/versions/1.9.3-p0 

Downloading ruby-1.9.3-p0.tar.gz... 
-> http://dqw8nmjcqpjn7.cloudfront.net/8e2fef56185cfbaf29d0c8329fc77c05 
Installing ruby-1.9.3-p0... 
Installed ruby-1.9.3-p0 to /Users/anderskitson/.rbenv/versions/1.9.3-p0 

Downloading rubygems-1.8.23.tar.gz... 
-> http://dqw8nmjcqpjn7.cloudfront.net/178b0ebae78dbb46963c51ad29bb6bd9 
Installing rubygems-1.8.23... 
Installed rubygems-1.8.23 to /Users/anderskitson/.rbenv/versions/1.9.3-p0 

Anderss-MacBook-Pro:anchor anderskitson$ ruby --version 
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] 
Anderss-MacBook-Pro:anchor anderskitson$ rbenv global 1.9.3-p0 
Anderss-MacBook-Pro:anchor anderskitson$ ruby --version 
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] 
Anderss-MacBook-Pro:anchor anderskitson$ rbenv version 
1.9.3-p0 (set by /Users/anderskitson/.rbenv/version) 
Anderss-MacBook-Pro:anchor anderskitson$ 

UPDATE

我得到了這一點,放了rbenv全球

Anderss-MacBook-Pro:anchor anderskitson$ $ rbenv global 1.9.3-p0 
-bash: $: command not found 

回答

3

你需要設置你希望你的外殼與安裝了Ruby版本後rbenv global使用紅寶石版本rbenv。

$ rbenv global 1.9.3-p0 

查看these docs瞭解更多信息。

+0

我輸入此命令並找不到命令 – 2013-02-20 20:48:13

+0

您是否偶然抄襲了前面的$符號?這僅用於表示這是要在控制檯中運行的語句。 – 2013-02-20 20:49:29

+1

@TomasKlemm它的工作 – 2013-02-20 21:41:23