s7rqcg
Last Updated: February 25, 2016
·
2.404K
· liquid
D0e7a53bc25c2827451d9f5b14561e05

Installing Ruby Enterprise Edition on OS X 10.9 Mavericks

Just a quick brain dump for future reference:

(I should improve this article at some point later on but I currently have no time to do that, sorry)

First of all, as you know Ruby versions prior to 1.9.3 do not compile with Apple's LLVM so we need GCC from Homebrew:

$ brew tap homebrew/dupes
$ brew install apple-gcc42

XCode 5.0 does not install header files to /usr/include anymore, instead these are distributed with XCode itself and can be pragmatically be detected with the new --show-sdk-path flag in xcrun.

Having said that we need to set some environment variables to specify additional switches to be passed to the compiler in the process of building Ruby:

$ export CPPFLAGS="-I$(xcrun --show-sdk-path)/usr/include"
$ export CFLAGS="-I$(xcrun --show-sdk-path)/usr/include -L$(xcrun --show-sdk-path)/usr/lib"

Time to install ruby:

$ rbenv install ree-1.8.7-2011.12

This should do the trick, Rbenv will compile Ruby and install Rubygems. You can verify if the install was successful by querying your installed versions of rubies:

$ rbenv versions
Say Thanks
Respond

2 Responses
Add your response

10280
D0d3d77f700786b0f7768ca56be353d0

Thanks for this! It worked beautifully for me via ruby-build and 1.9.1-p430.

over 1 year ago ·
10297
C0afdc1c900a8f7b429f786507e19758

if you already have the env set up and are having problems installing new gems:
xcode-select --install
and click 'install'

over 1 year ago ·