古いbrewが入ったmacにrbenvを入れる

OSアップデート済みの旧macにrbenvを入れようとすると以下のエラーが。

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require':/usr/local/Library/Homebrew/download_strategy.rb:88: invalid multibyte escape: /^\037\213/ (SyntaxError)

どうやらbrewrubyの1.8で動いているがOSアップデートでrubyのバージョンが2.0にアップデートされた為、バージョン不一致のエラーになっている模様。

brewをアップデートするほかないので、

$ cd /usr/local/Library/Homebrew/
$ sudo git reset --hard origin/master
$ sudo git pull origin master
$ sudo chown root:wheel /usr/local
$ brew update

で、rbenvを入れてみようとすると、、、

$ brew install rbenv ruby-build
Error: /usr/local/opt/autoconf not present or broken
Please reinstall autoconf. Sorry :(

autoconfがおかしい的なことを言われたので、

$ brew unlink autoconf && brew link autoconf

これでrbenvが入る。

$ brew install rbenv ruby-build