install Ruby 2.0 with Homebrew
$ brew upgrade ruby-build
==> Upgrading 1 outdated package, with result:
ruby-build 20130408
==> Upgrading ruby-build
==> Installing ruby-build dependency: autoconf
==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/autoconf/2.69
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.
Xcode (up to and including 4.2) provides (a rather old) Autoconf.
==> Summary
/usr/local/Cellar/autoconf/2.69: 69 files, 2.0M, built in 6 seconds
==> Installing ruby-build dependency: pkg-config
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pkg-config-0.28.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.28.mountain_lion.bottle.tar.gz
/usr/local/Cellar/pkg-config/0.28: 10 files, 636K
==> Installing ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/archive/v20130408.tar.gz
######################################################################## 100.0%
==> ./install.sh
/usr/local/Cellar/ruby-build/20130408: 75 files, 332K, built in 2 seconds
$ brew upgrade rbenv
==> Upgrading 1 outdated package, with result:
rbenv 0.4.0
==> Upgrading rbenv
==> Downloading https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz
######################################################################## 100.0%
==> Caveats
To use Homebrew's directories rather than ~/.rbenv add to your profile:
export RBENV_ROOT=/usr/local/var/rbenv
To enable shims and autocompletion add to your profile:
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
==> Summary
/usr/local/Cellar/rbenv/0.4.0: 31 files, 152K, built in 2 seconds
$ RUBY_CONFIGURE_OPTS="--enable-shared --with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
Installed ruby-2.0.0-p0 to /Users/matsuda/.rbenv/versions/2.0.0-p0
$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1e --openssldir=/usr/local/etc/openssl zlib-dynamic shared darwin64-x86_64-cc
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.1e/share/man MANSUFFIX=ssl
==> Caveats
To install updated CA certs from Mozilla.org:
brew install curl-ca-bundle
This formula is keg-only: so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
The OpenSSL provided by OS X is too old for some software.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
==> Summary
/usr/local/Cellar/openssl/1.0.1e: 429 files, 15M, built in 3.5 minutes