RVM: Installing Ruby 1.8.7 on Mac OSX 10.8

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, April 11, 2013

Follow me on Twitter as @mattiasgeniar

Just a quick command copy/paste to remind me in the future to help compile/configure ruby 1.8.7 via RVM on Mac OSX 10.8.

$ rvm install 1.8.7
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.8.7-p371.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

That sucks. Work-around as such:

$ rvm install 1.8.7 --with-gcc=clang 
Installing Ruby from source to: /Users/name/.rvm/rubies/ruby-1.8.7-p371, this may take a while depending on your cpu(s)...
ruby-1.8.7-p371 - #downloading ruby-1.8.7-p371, this may take a while depending on your connection...
ruby-1.8.7-p371 - #extracted to /Users/name/.rvm/src/ruby-1.8.7-p371 (already extracted)
Patch stdout-rouge-fix was already applied.
Patch no_sslv2 was already applied.
ruby-1.8.7-p371 - #configuring
ruby-1.8.7-p371 - #compiling
Error running 'make', please read /Users/name/.rvm/log/ruby-1.8.7-p371/make.log
There has been an error while running make. Halting the installation.

Which also sucks. Turns out rvm sort of bugs out for Ruby compiles if it includes tk/tcl support, something you most likely don’t need anyway. Workaround is as such:

$ rvm install 1.8.7 --with-gcc=clang --without-tcl --without-tk
Installing Ruby from source to: /Users/name/.rvm/rubies/ruby-1.8.7-p371, this may take a while depending on your cpu(s)...
ruby-1.8.7-p371 - #downloading ruby-1.8.7-p371, this may take a while depending on your connection...
ruby-1.8.7-p371 - #extracted to /Users/name/.rvm/src/ruby-1.8.7-p371 (already extracted)
Patch stdout-rouge-fix was already applied.
Patch no_sslv2 was already applied.
ruby-1.8.7-p371 - #configuring
ruby-1.8.7-p371 - #compiling
ruby-1.8.7-p371 - #installing 
Retrieving rubygems-1.8.25
Extracting rubygems-1.8.25 ...
Removing old Rubygems files...
Installing rubygems-1.8.25 for ruby-1.8.7-p371 ...
Installation of rubygems completed successfully.
Saving wrappers to '/Users/name/.rvm/bin'.
ruby-1.8.7-p371 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.8.7-p371 - #importing default gemsets, this may take time ...
Install of ruby-1.8.7-p371 - #complete

Win!

$ rvm list

rvm rubies

   ruby-1.8.7-p371 [ i686 ]
   ruby-1.9.2-p320 [ x86_64 ]
   ruby-1.9.3-p374 [ x86_64 ]


Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.