4imsra
Last Updated: September 21, 2016
·
38.32K
· amirtcheva
Dd1ca1288610b1750af31b0f22a51d6c

Upgrading Ruby to 2.1.0 (and above) in Mavericks

Mavericks comes installed with Ruby 2.0.0, so your current version of ruby should be the following (if you haven't touched Ruby since upgrading to Mavericks):

ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

I wanted to use RailsInstaller for this because it's seamless, but they don't have an updated install package for the newest version of Ruby and Mac OS X, so I used RVM instead.
Run the following to install RVM and the latest stable version of Ruby:

\curl -L https://get.rvm.io | bash -s stable --ruby

Install the Ruby interpreter:

rvm install 2.1.0 --autolibs=enable

After that's finished installing, run:

source /Users/{your_user_name}/.rvm/scripts/rvm

Run:

ruby -v
ruby 2.1.0p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]

Then run:

rvm use 2.1.0

Or:

rvm 2.1.0

(The commands are equivalent)

To make this the default version of Ruby for future sessions, run:

rvm --default 2.1.0

After this, I had issues getting Rails 4 to work, the following made it possible:

rvm gemset create rails-4.0
rvm 2.1.0@rails-4.0  

The above allows Rails to store gems associated with the particular folder, otherwise, it will try to compile the system version of Rails. After, install Rails 4.0:

gem install rails --version 4.0.0 --no-ri --no-rdoc

Follow the any messages you might get from bundler to update your gems after Rails has finished installing.

10 Responses
Add your response

14283
0 smdaavjez 9deikgshmjazehnthehlkgf7jlamwvwbqzctbj3ejgxj0qsp8bwgllusiroozankqn

thx for the tuto.
Worked great here (on Mtn Lion server)

over 1 year ago ·
14389

Thank you! Greetings from Chile

over 1 year ago ·
15085
4312a2f9f6bd751ec199bbcc09ea1c93 normal

thanks!

over 1 year ago ·
18231
None

Thanx for the steps! worked great.

over 1 year ago ·
21137
None

Awesome, thankyou!

over 1 year ago ·
21408
None

On Yosemite the curl command dies with
About to install Homebrew, press Enter for default installation in /usr/local,
type new path if you wish custom Homebrew installation (the path needs to be writable for user)
: Requirements installation failed with status: 1.

What's that about?

over 1 year ago ·
21933
None

Thanks for the tutorial! Much appreciated!

over 1 year ago ·
21934
Dd1ca1288610b1750af31b0f22a51d6c
over 1 year ago ·
23260
None

thanks!

over 1 year ago ·
26670
None

@jmagosta install Homebrew first, that resolved the same issue I had.

over 1 year ago ·