- Download Xcode from the App Store.
- Run Xcode and open the app's Preferences.
- Open the Downloads tab, then download and install Command Line Tools for Xcode.
- Download and expand Ruby 1.9.2 (stable) source from the official Ruby website.
- Launch the Terminal app.
- Change to the directory containing the expanded Ruby source code.
$ ./configure
$ make
$ sudo make install
Then, to use the newly installed version of Ruby (instead of the pre-installed version that came with Lion):
$ export PATH=/usr/local/bin:$PATH
To summarize the results... Before installing Ruby 1.9.2:
$ irb -v irb 0.9.5(05/04/13) $ ruby --version ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
After installing Ruby 1.9.2:
$ ruby --version ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.3.0] $ irb -v irb 0.9.6(09/06/30)
Thank you, Mike Clark, for pointing out that with Lion I now have to download Command Line Tools for Xcode in order to compile stuff.
Thank you, Ubuntu community, for giving instructions on how to compile programs from source code.
... And finally, with no further ado, I present: the rant behind this post!
Programming an application is supposed to be difficult and require significant thinking. Installing the compiler or interpreter or whatever package is necessary to run the code should be easy.
Maybe it's just me... but why in the world did it take me 2 hours and so much frustration to get Ruby setup on my Mac? Ruby's website says, "Compiling from Source is the standard way that software has been delivered for many, many years. This will be most familiar to the largest number of software developers." Thanks. For assuming incorrectly that I know how to "compile from source" and providing zero instructions for how to do that on my OS.