Ruby 2.1.1インストール

rbenv + ruby-buildでRuby 2.1.1をインストールしようとしたらビルドが失敗したのでメモ。
結論から言うとreadlineのバージョンを下げてインストールできた。

$ cd ~/.rbenv;git pull
$ cd plugins/ruby-build;git pull
$ rbenv install 2.1.1
Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
Installing ruby-2.1.1...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/mb/3kb7lflx1j999k3cjdkp2gfw0000gn/T/ruby-build.20140506005126.60566
Results logged to /var/folders/mb/3kb7lflx1j999k3cjdkp2gfw0000gn/T/ruby-build.20140506005126.60566.log

Last 10 log lines:
compiling ossl_x509crl.c
compiling ossl_x509ext.c
1 warning generated.
compiling ossl_x509name.c
compiling ossl_x509req.c
compiling ossl_x509revoked.c
compiling ossl_x509store.c
installing default openssl libraries
linking shared-object openssl.bundle
make: *** [build-ext] Error 2
$ brew uninstall readline
$ cd /usr/local
$ git checkout 0181c8a Library/Formula/readline.rb
$ brew install readline
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/readline-6.2.4.mavericks.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring readline-6.2.4.mavericks.bottle.2.tar.gz
==> Caveats
$ RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.1.1
$ rbenv global 2.1.1
$ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]

Building Ruby 2.x on OS X Mavericks Suddenly Fails · Issue #550 · sstephenson/ruby-build · GitHub