2012-11-26 50 views
1

我以为我已经安装了ruby 1.9.3-p327。但是当我做ruby -v时,它仍然输出1.8.7,如下所示。在Mac OSX上安装1.9.3后显示Ruby 1.8.7

有什么不对?

我使用OSX 10.7.5,我安装了osx-gcc-installer和Xcode 4.5.2。

更新: 我检查/User/teacher/.rvm/bin/folder,我发现有ruby-1.9.3文件。

Last login: Mon Nov 26 19:50:24 on ttys000 
sokada-macbook:~ teacher$ sudo rvm install 1.9.3 
Password: 
No binary rubies available for: downloads/ruby-1.9.3-p327. 
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies. 
Fetching yaml-0.1.4.tar.gz to /Users/teacher/.rvm/archives 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
100 460k 100 460k 0  0 184k  0 0:00:02 0:00:02 --:--:-- 196k 
Extracting yaml to /Users/teacher/.rvm/src/yaml-0.1.4 
Configuring yaml in /Users/teacher/.rvm/src/yaml-0.1.4. 
Compiling yaml in /Users/teacher/.rvm/src/yaml-0.1.4. 
Installing yaml to /Users/teacher/.rvm/usr 
Installing Ruby from source to: /Users/teacher/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)... 
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection... 
ruby-1.9.3-p327 - #extracting ruby-1.9.3-p327 to /Users/teacher/.rvm/src/ruby-1.9.3-p327 
ruby-1.9.3-p327 - #extracted to /Users/teacher/.rvm/src/ruby-1.9.3-p327 
ruby-1.9.3-p327 - #configuring 
ruby-1.9.3-p327 - #compiling 
ruby-1.9.3-p327 - #installing 
Retrieving rubygems-1.8.24 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
100 371k 100 371k 0  0 819k  0 --:--:-- --:--:-- --:--:-- 1819k 
Extracting rubygems-1.8.24 ... 
Removing old Rubygems files... 
Installing rubygems-1.8.24 for ruby-1.9.3-p327 ... 
Installation of rubygems completed successfully. 
Saving wrappers to '/Users/teacher/.rvm/bin'. 
ruby-1.9.3-p327 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake). 
ruby-1.9.3-p327 - #importing default gemsets (/Users/teacher/.rvm/gemsets/), this may take time ... 
Install of ruby-1.9.3-p327 - #complete 
'rvm_codesign_identity' is not set, please set it in ~/.rvmrc 
sokada-macbook:~ teacher$ rvm -v 

rvm 1.16.20 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/] 

sokada-macbook:~ teacher$ ruby -v 
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] 
sokada-macbook:~ teacher$ chmod -x $rvm_path/hooks/after_install_codesign 
sokada-macbook:~ teacher$ ruby -v 
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] 
sokada-macbook:~ teacher$ 
+0

'/Users/teacher/.rvm/bin/ruby -v'? –

+0

我得到'没有这样的文件或目录'。但是我在该文件夹中发现了ruby-1.9.3-p327。 – shin

回答

4

使用rvm install会下载并编译红宝石版本,但你仍然需要声明要使用哪个版本。

尝试:

$ rvm use 1.9.3-p327 

切换到新安装的红宝石版本。要切换的版本,并设置为默认值:

$ rvm --default use 1.9.3-p327 

rvm website有更多信息一些伟大的文档。

+0

我刚刚发现“rvm使用1.9.3 - 默认”,它的工作。感谢您的回复。 – shin