shin
shin

Reputation: 32721

Showing Ruby 1.8.7 after installing 1.9.3 on Mac OSX

I thought I have installed ruby 1.9.3-p327. But when I do ruby -v, it still output 1.8.7 as you see below.

What is wrong?

I use OSX 10.7.5 and I installed osx-gcc-installer and Xcode 4.5.2.

UPDATES: I checked /User/teacher/.rvm/bin/folder and I found there are ruby-1.9.3 files.

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$ 

Upvotes: 1

Views: 1464

Answers (1)

rossta
rossta

Reputation: 11494

Using rvm install will download and compile a ruby version, but you still need to declare which version you want to use.

Try:

$ rvm use 1.9.3-p327

to switch to your newly installed ruby version. To switch versions and set as default:

$ rvm --default use 1.9.3-p327

The rvm website has some great docs with more info.

Upvotes: 3

Related Questions