Getting Ruby 1.8.7 installed on Mountain Lion (10.8)

Paul picture Paul · Sep 18, 2012 · Viewed 10.4k times · Source

I'm having a lot of trouble getting Ruby 1.8.7 installed on my clean install of Mountain Lion. I've looked around on Stack Overflow and don't see anything that specifically addresses this issue and hope that someone might have encountered this before.

I'm using the command line tools that can be downloaded with Xcode

I haven't had any problems installing Ruby 1.9.3 via RVM and HomeBrew. When I try to install 1.8.7 I get the following message after it tries to compile:

I first ran the command

rvm install 1.8.7

This gave me this error

The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

After digging around a bit I tried

rvm install 1.8.7 --with-gcc=clang

Error running 'make ', please read /Users/paulzaich/.rvm/log/ruby-1.8.7-p370/make.log
There has been an error while running make. Halting the installation.
Ruby 'ruby-1.8.7-p370' was built using clang - but it's not (fully) supported, expect errors.
Please be aware that you just installed a ruby that requires        2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.

At this point I did some more searching and found something about needing compile my own readline. RVM Does Not Install Ruby 1.9.2 on Snow Leopard: 'Error running 'make '

This unfortunately seemed to corrupt my entire rvm install including 1.9.3. I tried to reinstall 1.9.3 and got the same errors I as I was getting with 1.8.7. I completely deleted RVM at this point and reinstalled. Had no problem installing 1.9.3 again.

I also tried updating all versions of rvm based off of this post RVM issue with Mountain Lion. No luck there either.

Update: I also tried using this walkthrough for REE 1.8.7 which recommended installing gcc-4.2. No luck unfortunately.

Update 2: I reference rvm requirements and installed the following packages

brew update
brew tap homebrew/dupes 
brew install autoconf automake apple-gcc42 
rvm pkg install openssl

So far so good. Then I referenced this post on needing to reference the GCC compiler. I determined that the links referenced might not be correct because I'm using homebrew? I found the compiler in my Cellar folder and used the following command

CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7

No luck. Same error messages as before.

Answer

Paul picture Paul · Sep 18, 2012

I just figured it out! Please reference this question on SO

rvm can no longer install 1.8.7-p352 on Mac OS X Mountain Lion

rvm reinstall 1.8.7 --without-tcl --without-tk

Alternatively, try this installation order if you have Homebrew.

brew install tcl-tk

rvm reinstall 1.8.7