3

Last time when I was using brew and Git, which was a couple of weeks ago, everything was working perfectly fine. Now, however, when I type git --version in the terminal I get

git: error: unable to find utility "git", not a developer tool or in PATH. 

I do have a Git folder in my /usr/local directory though ...

If I try brew update, I get the very same error, plus

Error: Failure while executing: git init. 

brew install git results in:

clang: error: unable to find utility "clang", not a developer tool or in PATH
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

So, apparently, something is seriously wrong with my Git (and brew?) Installation or at least its path.

If I provide the path manually by entering

export PATH=/usr/local/git/bin:$PATH

in the terminal and then ask for my Git version, I get the correct output:

git version 2.3.5

Can someone tell me what's going wrong here or how I can fix my path for Git and brew in order to work again?

theB
  • 6,450
  • 1
  • 28
  • 38
ci7i2en4
  • 834
  • 1
  • 13
  • 27
  • This might be related to a recent update in the OS X command line tools. – chepner Apr 25 '15 at 12:42
  • Yes, there have been a quite a few updates for Xcode and the Command Line Tools recently. But as mentioned below I was already able to fix git by adding its location to my PATH. Now I need to fix brew/otool too ... – ci7i2en4 Apr 25 '15 at 12:44
  • What does `echo $PATH` say? – robertklep Apr 25 '15 at 12:58
  • /usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/System/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin ... Weird thing is that the path to git seems to be in there twice. The one at the end is the one I added a couple of minutes ago and that made git working. Be that as it may, now it's about otool. What do I need to add? – ci7i2en4 Apr 25 '15 at 13:12
  • Your PATH looks okay. Have you moved Xcode by any chance? What does `xcode-select -p` say? – robertklep Apr 25 '15 at 17:01
  • No, I haven't tampered with Xcode in any way. Just installed the updates that were released by Apple in the past couple of weeks. The ouput of the command you mention is "/Applications/Xcode.app/Contents/Developer" – ci7i2en4 Apr 25 '15 at 21:48
  • Have you tried If `xcodebuild` command work as expected and If you have any XCode Plugins in the plugins Folder located at `~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins` who can cause this issue. – Atika May 01 '15 at 22:09

1 Answers1

4

OMG, I figured it all out! There is one thing I did two weeks ago: I installed Python 3.4 and uninstalled Python 2.7 that is preinstalled on OS X. And just now I found out that Python 2.7 is vital for Xcode, so I simply installed it again.

Now that both Python versions are on my system, not only does Xcode work without complaint again but brew doesn't produce any errors anymore either ...

ci7i2en4
  • 834
  • 1
  • 13
  • 27