Reputation: 291
I have ruby 1.9.2p320 installed on my Mac and I tried to update it but don't know how so I used rvm to install ruby 1.9.3 and once that had finished installing, after typing ruby -v
I still get ruby 1.9.2p320.
I now have ruby 1.9.3 installed thanks to Simone Carletti!
Upvotes: 1
Views: 452
Reputation: 714
You can also install use rbenv to install and manage different versions of Ruby.
Note: I don't have anything against rvm. I simply noticed that installing various Rubies is a constant source of questions, both in Stack Overflow and also at work!
Requirements
/usr/local/
after installation is complete, or you can run into mysterious-looking errors that should not be preventing you from installing Ruby.)rvm implode
before installing rbenv. This will destroy rvm.To install rbenv using Homebrew
Update Homebrew.
$ brew update
Install rbenv.
$ brew install rbenv
Install ruby-build.
$ brew install ruby-build
Follow the instructions listed after installing these formulae in order to make it available correctly in your shell.
To install Ruby 1.9.3
See what versions of Ruby you can install.
$ rbenv install
Install one. The lastest as of this post is 1.9.3-p194
.
$ rbenv install 1.9.3-p194
To use Ruby 1.9.3
$ rbenv global 1.9.3-p194
To rehash rbenv
Sometimes you need to run rbenv rehash
, like when you install a gem that has native extensions for your operating system.
$ rbenv rehash
There are lots of other things you can do with rbenv, like use a particular Ruby in a particular directory, or a particular ruby in the shell. See the appropriate docs for more info!
Upvotes: 1
Reputation: 176402
To install a Ruby version with RVM
$ rvm install 1.9.3
then to switch to it
$ rvm use 1.9.3
The latter command is probably the one you forgot to execute.
You might want to configure an .rvmrc file for your project in order to remember the settings.
About the other issue, you should open a separate question.
Upvotes: 2