jnthnclrk
jnthnclrk

Reputation: 468

I'm confused, what's the easiest way to install Ruby 1.9.2 on OS X?

My current version is ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10]

Upvotes: 1

Views: 365

Answers (3)

Andrei Andrushkevich
Andrei Andrushkevich

Reputation: 9973

if you will get error

undefined method `path' for Gem:Module (NoMethodError)

during command

~/rubygems-1.3.7 $ ruby setup.rb

remove ruby and rubygems with command

sudo autoremove ruby
sudo autoremove rubygem

ant try to install all again

Upvotes: 0

stef
stef

Reputation: 14268

Step 1. Install Homebrew: https://github.com/mxcl/homebrew

This enables you to install various *IX projects on a mac. You may need to install xcode as part of this, so you may need your OS X disc to hand. Homebrew is useful for many other things - a good thing to have installed anyway.

Step 2. Install Ruby Version Manager:

brew install rvm

Step 3. Install whichever Ruby version you want. This means you can have multiple Ruby installations (with their own sets of rubygems) running independently of one another. for 1.9.2 try this:

rvm install 1.9.2

If you get a 'readline' error, try this:

rvm package install readline
rvm remove 1.9.2
rvm install 1.9.2 --with-readline-dir=$rvm_path/usr

You should now be able to do this to test your ruby version:

ruby --version

To switch back to another version of ruby, just use the rvm command.

Upvotes: 5

Jimmy Huang
Jimmy Huang

Reputation: 4312

You can try rvm to install whatever the version of ruby.

Upvotes: 3

Related Questions