How do I make ruby 1.9 the default version to use instead of the 1.8.x that is by default installed on os x?
Thanks.
How do I make ruby 1.9 the default version to use instead of the 1.8.x that is by default installed on os x?
Thanks.
Hi,
look at this answer about RVM http://stackoverflow.com/questions/3243088/installing-rvm-ruby-version-manager
I recommend installing the RVM tool from http://rvm.beginrescueend.com/ (it has instructions on installing it
It allows you to have multiple versions of ruby and gems. After installing RVM, then install the Ruby 1.9 you want, using:
rvm install ruby-1.9.1
To make it the default one:
rvm --default ruby-1.9.1
After this, it will be the default ruby.
RVM is great for setting up multiple environments with different versions of Ruby and gems.
If you however just want to have Ruby 1.9 you can simply install it using MacPort. It will take precedence over the one already installed by default on OS X.
sudo port selfupdate
sudo port install ruby19
sudo port install rb-rubygems
You should then have Ruby 1.9 installed and ahead on the path. Do a ruby -v to check. Use Ruby gems to install any other Ruby components like Rails.
Ports are installed in the /opt/local/bin directory and MacPort updates the PATH environment variable so that these are picked up before the /usr/bin pre-installed packages.