Mac OS X(Lion)にrbenvをインストール

前提:Homebrewがインストールされていること。
Mac OS X(Lion)にHomebrewをインストール - Change The Worlds

1. rbenvをインストール


$ brew install rbenv
==> Downloading https://github.com/sstephenson/rbenv/tarball/v0.3.0
######################################################################## 100.0%
==> Caveats
To enable shims and autocompletion, add rbenv init to your profile:
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
==> Summary
/usr/local/Cellar/rbenv/0.3.0: 32 files, 160K, built in 2 seconds

2. 続けて、ruby-buildをインストール


$ brew install ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/tarball/v20120524
######################################################################## 100.0%
==> ./install.sh
/usr/local/Cellar/ruby-build/20120524: 45 files, 196K, built in 2 seconds
3. .bash_profileにパスを通す。

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
$ echo 'eval "$(rbenv init -)"' >> .bash_profile
$ source .bash_profile

4. readlineをインストール


$ brew install readline
==> Downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
patching file vi_mode.c
patching file callback.c
patching file support/shobj-conf
patching file patchlevel
==> ./configure --prefix=/usr/local/Cellar/readline/6.2.2 --mandir=/usr/local/Cell
==> make install
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.

OS X provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.

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 its lib & include paths to your build variables:

LDFLAGS -L/usr/local/Cellar/readline/6.2.2/lib
CPPFLAGS -I/usr/local/Cellar/readline/6.2.2/include
==> Summary
/usr/local/Cellar/readline/6.2.2: 30 files, 1.6M, built in 21 seconds