Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I Install Ruby 1.9.2 with RVM on Mac OSX 10.7.3 LION?

I am following the Ruby on Rails tutorial and I'm hung up on installing Ruby 1.9.2. It has been stuck at the #compiling function for ~36 hours. I tried to find my configure.log file but I honestly haven't been able to.

What I have done so far: 1) Installed XCode 2) Installed GCC 10.7v2

The command I used:

RVM reloaded!
vinnies-macbook:~ vinnie$ rvm install 1.9.2 --with-gcc=clang
Fetching yaml-0.1.4.tar.gz to /Users/vinnie/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/vinnie/.rvm/src
Configuring yaml in /Users/vinnie/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/vinnie/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/vinnie/.rvm/usr
clang: error: unsupported option '--with-libyaml'
Building 'ruby-1.9.2-p318' using clang - but it's not (fully) supported, expect errors.
Installing Ruby from source to: /Users/vinnie/.rvm/rubies/ruby-1.9.2-p318, this may take a          while depending on your cpu(s)...

ruby-1.9.2-p318 - #fetching 
ruby-1.9.2-p318 - #extracted to /Users/vinnie/.rvm/src/ruby-1.9.2-p318 (already extracted)
ruby-1.9.2-p318 - #configuring 
ruby-1.9.2-p318 - #compiling 
like image 604
Vincent Barr Avatar asked Mar 05 '12 04:03

Vincent Barr


People also ask

Does RVM work on Mac?

The RVM install page has comprehensive instructions for installing RVM that work on Mac OS X. I'll provide the steps I used here. I've listed the mapis public key install command here for illustration. You should use the version on the RVM install page.


1 Answers

For Lion, you need to install GCC-4.2 and set the compile to point to it:

  1. Download the gcc-4.2

    This is needed for Xcode 4.2 only. Ruby project should be built using gcc rather than llvm-gcc (Lion).

    Download it from https://github.com/kennethreitz/osx-gcc-installer/downloads/

    Open "Downloads"

    Double click on "GCC-10.7-v2.pkg" to install

  2. Setting the compiler

    For Lion, Rubies should be built using gcc rather than llvm-gcc.

    Since /usr/bin/gcc is linked to /usr/bin/llvm-gcc-4.2, we need to set the default complier to gcc-4.2

    Set default complier to gcc-4.2, type command: export CC=/usr/bin/gcc-4.2

like image 141
yeowzir Avatar answered Sep 20 '22 20:09

yeowzir