Skip to content

Instantly share code, notes, and snippets.

@stephenmckinney
Created February 28, 2012 11:26
Show Gist options
  • Save stephenmckinney/1932021 to your computer and use it in GitHub Desktop.
Save stephenmckinney/1932021 to your computer and use it in GitHub Desktop.
Installing Ruby 1.8.7 on Lion with only Command Line Tools for Xcode non-llvm gcc 4.2

Installing older Rubies (e.g. Ruby 1.8.7) on a clean install of Lion and Xcode

The latest Xcode and Command Line Tools for Xcode changes the default compiler from gcc to the llvm compiler. Only ruby-1.9.3-p125+ is LLVM ready. So, you will have to install gcc-4.2 to compile older versions of Ruby. More detail here https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers.

This worked for me. I hope it saves some people time:

brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7
@behrangsa
Copy link

@stephenmckinney
Copy link
Author

Duplicates in Homebrew-Alt were moved to Homebrew-Dupes. I've updated the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment