Mavericksにアップデートしたら、rbenvが消えた件
備忘録です。
MBPのOSをMavericksにアップデートしたら、terminal上で、rbenvが見えなくなりました。
$ which rbenv rbenv not found
rbenvは、Homebrewを使ってインストールしたので、brewコマンドで存在を確認します。 brewによると、rbenvは存在するようです。
$ brew list rbenv /usr/local/Cellar/rbenv/0.4.0/bin/ruby-local-exec /usr/local/Cellar/rbenv/0.4.0/bin/rbenv /usr/local/Cellar/rbenv/0.4.0/completions/ (2 files) /usr/local/Cellar/rbenv/0.4.0/libexec/ (25 files)
brewの状態を確認した
--
依存関係がおかしかったり、問題はあるのですが、rbenvが見えなくなった件とは関係ありませんでした。
--
brewがおかしいのかもしれないので、まずチェックしました。
$ brew doctor Warning: Some installed formula are missing dependencies. You should `brew install` the missing dependencies: brew install freetype libpng Run `brew missing` for more details. Error: Homebrew doesn't know what compiler versions ship with your version of Xcode (5.1). Please `brew update` and if that doesn't help, file an issue with the output of `brew --config`: https://github.com/mxcl/homebrew/issues Thanks! Warning: Your Homebrew is outdated. You haven't updated for at least 24 hours, this is a long time in brewland! To update Homebrew, run `brew update`.
依存関係の解決が必要なのと、Homebrew自体が古いと言われました。
先にupdateしたほうがいいかと思ったのですが、エラーになりました。しかも、解決しにくい。
$ brew update Error: undefined method `to_sym' for nil:NilClass Please report this bug: https://github.com/mxcl/homebrew/wiki/troubleshooting /usr/local/Library/Homebrew/cmd/update.rb:134:in `report' /usr/local/Library/Homebrew/cmd/update.rb:132:in `each_line' /usr/local/Library/Homebrew/cmd/update.rb:132:in `report' /usr/local/Library/Homebrew/cmd/update.rb:36:in `update' /usr/local/Library/brew.rb:91:in `send' /usr/local/Library/brew.rb:91
brewのupdateは置いといて、指示された順番に、依存関係の解決からやりましょう。
コマンドも指示されているので、そのまま実行。
$ brew install libpng freetype ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.10.mavericks.bottle.tar.gz ######################################################################## 100.0% ==> Pouring libpng-1.6.10.mavericks.bottle.tar.gz 🍺 /usr/local/Cellar/libpng/1.6.10: 17 files, 1.3M ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/freetype-2.5.3_1.mavericks.bottle.tar.gz ######################################################################## 100.0% ==> Pouring freetype-2.5.3_1.mavericks.bottle.tar.gz 🍺 /usr/local/Cellar/freetype/2.5.3_1: 60 files, 2.5M
この後、update実行かと思ったのですが、チェックするとエラーなくなってる。
$ brew doctor Your system is ready to brew.
brewインストールしたコマンドが入る場所が空になってた
brewでインストールしたコマンドは通常、/usr/local/binに入ります。 が、見てみたらbrewしかいなかった。
$ ls -l /usr/local/bin -rwxr-xr-x 1 hoge admin 813B 3 25 11:50 brew
brewのインストール済みリストと違う。
$ brew list autoconf git jpeg lua phantomjs rbenv sbt freetype gnuplot libpng mysql pidof readline scala gd imagemagick libtool openssl pkg-config ruby-build
エイリアスは消えちゃったみたいです。
再インストールしようにも、インストール済みの場合は、なにもしてくれない。 (インストールには、Xcode Command Line Toolsも必要です。)
$ brew install rbenv Warning: rbenv-0.4.0 already installed
なので、アンインストールしてから、インストールしました。
$ brew uninstall rbenv Uninstalling /usr/local/Cellar/rbenv/0.4.0... $ brew install rbenv (中略) $ which rbenv /usr/local/bin/rbenv
地味に手間取ってしまった。残念。
--
追記 brew上ではインストール済みだったので、リンクだけ復活させればよかったかも。
brew link rbenv