Problems when i use homegrown

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

but he 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. he 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 lib and include in "sudo chown 755 include" "sudo chown 755 lib" the first and second warning are deleted, but the third one still exists.

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

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

+11
git include homebrew
Jun 11 '15 at 12:45
source share
2 answers

The problem is that Xcode for some reason cannot find its own command line tools:

 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 xcode-select --print-path in terminal.

If it is /Applications/Xcode.app/Contents/Developer , run sudo xcode-select --switch /Library/Developer/CommandLineTools to install xcode-select for command-line tools other than Xcode.

If you do not have the /Library/Developer/CommandLineTools , you can get them at https://developer.apple.com/downloads/ for the current version of Xcode.

+41
Jun 17 '15 at 20:48
source share

Firstly. You may need to upgrade your hometown before installing:

 brew update 

Secondly. Perhaps this instruction helps (taken from Ask Different ). At least this is helpful in solving your problem:

  brew install git $ git --version git version 1.7.12.4 (Apple Git-37) $ which git /usr/bin/git **// doh! osx pre-installed git trumps the brew one, so:** $ sudo mv /usr/bin/git /usr/bin/git-apple $ which git /usr/local/bin/git $ git --version git version 1.8.2 // ok cool. 
+1
Jun 14 '15 at 19:09
source share



All Articles