install and set up rbenv and ruby-build
########################################################################
# https://github.com/sstephenson/rbenv
########################################################################
$ brew install rbenv
==> Downloading https://github.com/sstephenson/rbenv/tarball/v0.2.1
######################################################################## 100.0%
/usr/local/Cellar/rbenv/0.2.1: 32 files, 156K, built in 2 seconds
$ brew install ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/tarball/v20110928
######################################################################## 100.0%
==> ./install.sh
/usr/local/Cellar/ruby-build/20110928: 21 files, 88K, built in 2 seconds
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ exec $SHELL
$ ruby-build --definitions
1.8.6-p420
1.8.7-p249
1.8.7-p352
1.9.1-p378
1.9.2-p290
1.9.3-dev
1.9.3-preview1
1.9.3-rc1
1.9.4-dev
jruby-1.6.3
jruby-1.6.4
jruby-1.7.0-dev
rbx-1.2.4
rbx-2.0.0-dev
ree-1.8.6-2009.06
ree-1.8.7-2010.02
ree-1.8.7-2011.03
########################################################################
$ rbenv install
usage: rbenv install VERSION
rbenv install /path/to/definition
Available versions:
1.8.6-p420
1.8.7-p249
1.8.7-p352
1.9.1-p378
1.9.2-p290
1.9.3-dev
1.9.3-preview1
1.9.3-rc1
1.9.4-dev
jruby-1.6.3
jruby-1.6.4
jruby-1.7.0-dev
rbx-1.2.4
rbx-2.0.0-dev
ree-1.8.6-2009.06
ree-1.8.7-2010.02
ree-1.8.7-2011.03
########################################################################
$ CONFIGURE_OPTS="--with-readline-dir=/usr/local" rbenv install 1.9.2-p290
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/matsuda/.rbenv/versions/1.9.2-p290
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz...
Installing ruby-1.9.2-p290...
Installed ruby-1.9.2-p290 to /Users/matsuda/.rbenv/versions/1.9.2-p290
Downloading http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz...
Installing rubygems-1.8.10...
Installed rubygems-1.8.10 to /Users/matsuda/.rbenv/versions/1.9.2-p290
$ rbenv global 1.9.2-p290
$ rbenv rehash
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
# Installs autocompletion
$ mkdir .rbenv/completions && ln -s /usr/local/Cellar/rbenv/0.2.1/completions/rbenv.bash .rbenv/completions/rbenv.bash
$ echo 'source ~/.rbenv/completions/rbenv.bash' >> ~/.bash_profile