Akata Works

東京エンジニア。主にRuby,Go,たまにAWSとiOS。ゲーム音楽が好きです。連絡はTwitterかakata.onen@gmail.comまで

Homebrewで"configure: error: cannot run C compiled programs"が出た

最近、iOS 9の開発のためにMac OSXをEl Capitan 10.11 Betaに、
XcodeXcode 7 Beta変えたところ、
しばらく使っていたら、急にtigが使えなくなりました・・

なんか依存ライブラリのReadlineが死んでいたっぽいので、
再インストールしてみました。

$ brew install readline

すると下のエラーが出ました。

==> ./configure --prefix=/usr/local/Cellar/readline/6.3.8 --enable-multibyte
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/private/tmp/readline20150915-84835-wmsgny/readline-6.3':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

取り敢えず、brew doctorコマンドで診察してみたところ、
どうも心当たりのある警告が出ていました。

Warning: Your Xcode (6.4) is outdated
Please update to Xcode 7.0.
Xcode can be updated from
  https://developer.apple.com/xcode/downloads/

あれ?Xcode入れたんだけどな

と思って、xcode-select

$ xcode-select -p
/Applications/Xcode 6.4.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer/

どうやらxcode-selectの参照がXcode 6.4になっていたことが原因だったみたいです。
Xcode 7 Betaにしたところ、インストールすることができました。

これに限らず、iOS 9の開発でバージョン上げてから何かと詰まることが多いなあ・・(´・ω・`)ショボーン