Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
573 views
in Technique[技术] by (71.8m points)

git - troubles when I use homebrew

I want to install git in my Mac(OS X 10.10.3).I write: brew install git

but it reported :

sh: line 1:  1549 Abort trap: 6           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find clang 2> /dev/null
clang: error: unable to find utility "clang", not a developer tool or in PATH
sh: line 1:  1552 Abort trap: 6           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find otool 2> /dev/null
otool: error: unable to find utility "otool", not a developer tool or in PATH
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool

then I write brew doctor. it reported:

Warning: /usr/local/include isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/include

Warning: /usr/local/lib isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/lib
sh: line 1:  1318 Abort trap: 6           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find otool 2> /dev/null
otool: error: unable to find utility "otool", not a developer tool or in PATH
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool

then I chown the lib and include with "sudo chown 755 include""sudo chown 755 lib" the first and second warning are removed but the third is still there.

And what confused me more is that in my finder:/usr/local/ the "include" and "lib" which should be folders but become files. how can I slove the error "cannot find otool" and install git with brew and

why my lib and include folder become files?... thanks for your help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem is that Xcode is unable to find its own Command Line Tools for some reason:

sh: line 1:  1549 Abort trap: 6      /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find clang 2> /dev/null
clang: error: unable to find utility "clang", not a developer tool or in PATH

Check out xcode-select --print-path in your Terminal.

If it's /Applications/Xcode.app/Contents/Developer then run sudo xcode-select --switch /Library/Developer/CommandLineTools to set xcode-select to non-Xcode Command Line Tools.

In case you don't have /Library/Developer/CommandLineTools directory, you can get them at https://developer.apple.com/downloads/ for your current Xcode version.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...