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
Written by Carlos Vilhena
Related protips
4 Responses
where do I set the cc env and where do I change the config options for rbenv?
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).
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.
Yeh, this was only useful when only the dev version was around. It is not needed anymore.