Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 263
Shawn Avatar asked Jun 11 '15 12:06

Shawn


People also ask

Why is Homebrew so slow?

brew list may be slower than it could be due to how some of the logic is overloaded - it's not used just for listing installed items, but also can filter by formulae only, casks only, unbrewed formulae, versions of a particular formula, pinned formulae only, etc.

How long should Homebrew take to install?

On a 1 Mbps Internet connection, installing Homebrew would, in theory, take about ~1 hour. As a one-time setup cost, this isn't too bad. However, it would be nice to make this better, especially given that most of the data transferred is git metadata that most users won't be making direct use of themselves.

Why does Homebrew need Xcode?

Xcode is an integrated development environment (IDE) that is comprised of software development tools for macOS. You won't need Xcode to use Homebrew, but some of the software and components you'll want to install will rely on Xcode's Command Line Tools package.


1 Answers

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.

like image 93
Ivan Mir Avatar answered Oct 13 '22 11:10

Ivan Mir