tech memorandom

Webに関して調査したことや、メディアアート系(Max,Processing)で調査したことなどを書いていきます。

xCode4.6.3でhomebrewでMakeエラーになる場合の対処

xCode v4.6.3でhomebrewでopen ni関連のライブラリをインストールしようとするとエラーになるようになった。あれこれ試したところ、gitなどもinstallできない。

/Users/coa% brew install git
==> Downloading http://git-core.googlecode.com/files/git-1.8.3.3.tar.gz Already downloaded: /Library/Caches/Homebrew/git-1.8.3.3.tar.gz ==> make prefix=/usr/local/Cellar/git/1.8.3.3 CC=cc CFLAGS= LDFLAGS= install ==> make CC=cc CFLAGS= LDFLAGS= git-credential-osxkeychain.c:114: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token git-credential-osxkeychain.c:155: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token git-credential-osxkeychain.c:173: error: old-style parameter declarations in prototyped function definition git-credential-osxkeychain.c:173: error: expected ‘{’ at end of input make: *** [git-credential-osxkeychain.o] Error 1

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

These open issues may also help: https://github.com/mxcl/homebrew/pull/17713 https://github.com/mxcl/homebrew/pull/20260 https://github.com/mxcl/homebrew/pull/19552 https://github.com/mxcl/homebrew/pull/19763 <

brew doctorを叩くとCommand Line Toolsをいれろとwarningがでるが、はいっている。 xCodeを入れなおしてもだめ。すでにInstall済の表示になっている。

トラブルシューティングのリンクができたのでたどってみると以下の記事にたどり着いた。

http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/

上記、記事のremove_CLI_tools.shのコードをシェルにして実行したところ、Command Line Toolsのuninstallに成功。

あらためてinstallしなおして、brew doctor

次はエラーがでない。

brew install gitを実行すると無事インストールできた。

ちなみにhomebrewにはxcode-selectというどこにxcodeがあるのかを定義している場所があり、そこも更新しないといけないようです。

/Users/coa% xcode-select --print-path <

/Applications/Xcode.app/Contents/Developerになっているか確認。もし別の場所になっていたら以下を実行。

/Users/coa% sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer <

なんだかんだで、ハマりました。

誰かの参考になるかと思い、いちを記事にしておきます。 この現象がおきるのはCommand Line Toolsに切り替わる前にbrewをつかっていた人のようです。