17

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.

4
  • 1
    Do you realise that the ruby that comes preinstalled is on mountain lion is 1.8.7 ? Commented Sep 18, 2012 at 5:46
  • I'd prefer to be able to move back and forth between rubies using RVM.
    – Paul
    Commented Sep 18, 2012 at 7:51
  • You can use rvm to switch back to the system provided ruby - rvm use system Commented Sep 18, 2012 at 8:24
  • Frederick, this might be a solution, thanks, but the existing RVRMC doesn't really like this.
    – Paul
    Commented Sep 18, 2012 at 8:58

3 Answers 3

48

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
4
  • That worked! Just the reinstall and options. Also note that the brew installs would technically come first before the reinstall command. Thanks Paul
    – Trip
    Commented Sep 19, 2012 at 14:37
  • Looks like the homebrew package name has since changed and combined tcl and tk into one: brew install tcl-tk Commented Apr 17, 2013 at 16:34
  • +1 on the reinstall and the -- options... the brew/rvm reinstall did not work for me (p371)
    – Joe Sak
    Commented Jul 19, 2013 at 16:14
  • Even this gives the same error Error running 'make -j24', please read /home/ava/.rvm/log/1378275411_ruby-1.8.7-p374/make.log There has been an error while running make. Halting the installation.
    – Ava
    Commented Sep 4, 2013 at 6:19
4

Just to follow up to Paul's post. I'm running OSX 10.8.2, had 1.9.3 install without issues, but 1.8.7-p370 also failed. I symlinked gcc-4.2:

sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2

...successfully ran:

brew install tcl

...but tk failed:

brewk install tk

If you're in the same spot, this command did the trick:

CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7 --without-tk
1

Latest Xcode provides only clang - not GNU gcc, you need to install gcc-4.2 to be able to compile Ruby 1.8.7 properly, following command will show available options:

rvm requirements

currently only ruby 1.9.3-p125 and later has limited support for clang, but this is limited support, and still errors can be found.

1
  • Yeah I tried that as well. brew update brew tap homebrew/dupes brew install autoconf automake apple-gcc42 rvm pkg install openssl Then used the info on this link: stackoverflow.com/questions/6170813/… CC=/usr/bin/gcc-4.2 rvm install 1.8.7 No luck
    – Paul
    Commented Sep 18, 2012 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.