mac os x how to upgrade to ruby 1.9.2
-
There are many options: RVM, which is favored by many of us, MacPorts and Fink, or compiling from source. Whatever you do, don't try to replace the default Ruby, as it's put there by Apple for their own purposes. What experience do you have installing languages? – the Tin Man Dec 29 '10 at 05:09
-
Saying RVM is favored by many of us is an appeal to popularity. You're absolutely correct about replacing the built in Ruby though. I tried that once just to see how well it would work and let's just say I really like SuperDuper! for backups and restores. – Dec 30 '10 at 16:29
-
25@Pekka: It's bad practice to respond to any question with "just google it". I actually came to this page after googling this question and then had to read your response saying the answer is on google. *facepalm* – Edward D'Souza Feb 12 '12 at 19:24
3 Answers
Perhaps not the answer you're looking for in the short term, but I highly recommend looking into Ruby Version Manager. It makes running concurrent versions of Ruby a breeze by switching out the entire environment for you (by means of updating your environment variables, generally). Different versions, different gems per version, etc.
-
2
-
11In general, after you install rvm (and modify your `.profile` to include it in shells), you just do `rvm install 1.9.2` and then `rvm use 1.9.2`. – Phrogz Dec 28 '10 at 14:21
-
1"This is by far the quickest way to get the latest Ruby on OS X", and, in my opinion, the safest, because everything goes into a `~/.rvm` sandbox. – the Tin Man Dec 28 '10 at 18:54
-
Sorry but -1 for suggesting RVM. It's HORRIBLE! It will delete gems randomly, cause your Ruby core to not even load, and its "documentation" is a joke. – Dec 28 '10 at 23:32
-
3Sorry, but +1 to counter since I have had very different experience with it. – the Tin Man Dec 29 '10 at 05:02
-
@Mike Bethany: Last night, rvm deleted ~/ruby . Ouch. (They've since fixed the bug) – Andrew Grimm Dec 30 '10 at 09:57
-
@Andrew Doh! Hate to say I told ya so but... The fact of the matter is RVM is dangerous, buggy code. I love the idea of it but the execution is sorely lacking and definitely not for anyone that needs to have a working system and not worry about bizarre behavior for what should essentially just be a symbolic link creator and path modifier. – Dec 30 '10 at 16:27
I think that the best option is to use Homebrew. The installation is simple:
brew install ruby
By the way, RVM does not support LLVM based gcc!
P. S. Homebrew is great choice because it has clear and good way to install things (without ruining your system), you can use it to install various "packages" like git, ghc, emacs etc.
P. P. S. Don't forget to path your new ruby, something like:
export PATH="$PATH:/usr/local/opt/ruby/bin"]
P. P. P. S. If you would like to use rvm, try this link: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/

- 205
- 2
- 5
-
2when I try on my mac, it says "Error: ruby not installed" even though it blantantly is – gotofritz Mar 22 '13 at 22:00
-
-
2I would set the path with `export PATH=/usr/local/opt/ruby/bin:$PATH` to put the new homebrew ruby in front of the system ruby in your path. – Alex Nauda Jan 17 '14 at 21:32
RVM main site doesn't install properly on OS X Lion. The instructions are incorrect, the error messages it spews are incorrect (refer to non-existent log files, etc).
Route that (eventually) worked for me:
- Open Xcode, go to Preferences - Downloads
- Make sure that "Command Line Tools" is installed (150 MB download); this is (silently) required for Ruby to install, and used to be part of OSX / Xcode by default, but no longer
- Ignore the RVM website - it links to bad installers for OS X (don't bother, not worth the pain. I tried them, they failed)
- use JewelryBox, which is a little less rubbish than the official installer: http://unfiniti.com/software/mac/jewelrybox
- Run it, click Add Ruby, select ruby-1.9.3-p125 (has to be that version or higher, or it won't compile, because the previous versions need a compiler thats no longer in OS X)
- Select "Autodetect" and "use clang"
- ...wait a LONG time...
- If JewelryBox crashes immediately, it means you missed either step 2 above, or step 6 above (RVM crashes spectacularly if clang isn't installed, and neither RVM nor jewelrybox checks in advance)
NB -- downloading will take approx 5 mins; "installing" will take 30-45 mins, because everything has to be compiled. There is apparently no "normal" way of installing Ruby :(.

- 32,900
- 16
- 126
- 153