Last Updated: February 25, 2016
·
5.803K
· carvil

Installing ruby 2.0.0-dev on Mac OS X ML

Installing ruby 2.0.0-dev on Mountain Lion wasn't as straight forward as I was expecting. In order to get it working, I had to:

update rbenv and ruby-build:

brew upgrade rbenv
brew upgrade ruby-build

or, if you didn't use homebrew to install them:

cd ~/.rbenv
git pull
cd plugins/ruby-build
git pull

set the CC env variable:

export CC=clang

Install openssl using homebrew, since 2.0.0-dev is incompatible with the default openssl version bundled with MacOS:

brew install openssl

set configuration options that tell rbenv to use the new openssl:

export CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`"

And finally install ruby:

rbenv install 2.0.0-dev

4 Responses
Add your response

where do I set the cc env and where do I change the config options for rbenv?

over 1 year ago ·

You can set it in the terminal (literally copy/paste the command into the terminal) or add it to your bashprofile/bashrc/zshrc/etc file and source it (e.g. source ~/.bashprofile).

over 1 year ago ·

But note that none of this is necessary now. rbenv install 2.0.0-p0 will download and install OpenSSL and then download and install Ruby 2, all in one smooth move.

over 1 year ago ·

Yeh, this was only useful when only the dev version was around. It is not needed anymore.

over 1 year ago ·