Install Ruby 2.0 Preview 2

Ruby Posted on

Ruby 2.0 is still a work in progress, but it's already at preview 2. If you're looking to play with it, here are some steps to install Ruby 2.0 Preview 2 on Mac OSX Mountain Lion (and older OSX versions)

Install Homebrew:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Make sure brew is up to date:

brew update

Install rbenv, ruby-build, and openssl:

brew install rbenv ruby-build openssl

Use rbenv to install Ruby 2.0

rbenv install 2.0.0-preview2

Special Cases

You may need to specify the location for the ssl directory:

CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview2

You may also need to specify a different GCC

CONFIGURE_OPTS=--with-gcc=clang rbenv install 2.0.0-preview2

I highly suggest you install Ruby 2.0. There are some significant speed improvements and optimizations in the language.

About Seth

Seth Vargo is a Distinguished Software Engineer at Google. Previously he worked at HashiCorp, Chef Software, CustomInk, and some Pittsburgh-based startups. He is the author of Learning Chef and is passionate about reducing inequality in technology. When he is not writing, working on open source, teaching, or speaking at conferences, Seth advises non-profits.