Mac OS X / Xcodeをバージョンアップしたらhomebrewが動かなくなる問題への対策

2016.03.30

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

tl;dr

https://github.com/Homebrew/homebrew/issues/50157

補足

Mac OSを10.11.4に更新し、同日App Storeに来ていたXcodeも更新してから、brew upgrade時に以下のようなエラーが出るようになりました。

$ brew upgrade
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool

brew updateでは発生しません。また、XCodeも起動しなくなりました。 GitHubでis:issue is:open install_name_toolを検索したところ、#50091を見つけ、#50091にリンクしていた#50157を発見しました。

$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

$ sudo xcode-select --switch /Library/Developer/CommandLineTools

これで、brew upgradeできるようになりました。