Homebrew doesn't find XCode 4.3

7

3

When I try to install something with homebrew I get an error message that it does not find XCode. But I just installed XCode 4.3 and also did a reboot.

admins-MacBook-Pro-2:~ ernst$ brew install macvim
Warning: Xcode is not installed! Builds may fail!
Error: No such file or directory - /usr/bin/cc
admins-MacBook-Pro-2:~ ernst$ 

Any ideas?

Update:

admins-MacBook-Pro-2:~ ernst$ which cc
admins-MacBook-Pro-2:~ ernst$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
admins-MacBook-Pro-2:~ ernst$ 

BetaRide

Posted 2012-02-16T17:14:04.483

Reputation: 2 099

Are the requires files in /Developer/usr/bin? Does it help to change the $PATH? – Daniel Beck – 2012-02-16T17:25:36.750

Does it work when you specify --use-llvm? – Daniel Beck – 2012-02-16T17:30:07.193

--use-llvm did not help, same error message. – BetaRide – 2012-02-16T17:52:18.273

There's no /Developer directory. – BetaRide – 2012-02-16T17:52:49.147

What could I change in $PATH? – BetaRide – 2012-02-16T17:53:01.190

Did you actually install Xcode or just download it from the App Store? There should be an application named "Install Xcode" in your applications folder. – Daniel Beck – 2012-02-16T17:57:31.457

It's installed, I can start it and create new projects. – BetaRide – 2012-02-16T17:58:17.503

Where was the Xcode application bundle installed to? What is the output of which cc on the command line? What's the output of echo $PATH? Did you download it from the Apple Developer Connection website or the App Store? – Daniel Beck – 2012-02-16T18:00:26.723

The download is from the App Store. – BetaRide – 2012-02-16T18:54:28.947

Answers

12

I had the same problem and found the solution in Homebrew's issues page. Open Xcode, open Preferences, select Downloads, and install Command Line Tools. Once it is installed Homebrew should work.

Rebecca Scott

Posted 2012-02-16T17:14:04.483

Reputation: 1 248

Weird cause I was under the impression that you wouldn't need XCode to get those tools but couldn't find them anywhere. Thanks for this answer, been frustrating me. – localshred – 2012-02-22T02:40:46.827

You can download the command-line tools separately from http://developer.apple.com/downloads (you need an Apple ID). The package requires Lion. For more details: http://kennethreitz.com/xcode-gcc-and-homebrew.html

– Teoulas – 2012-03-12T09:15:43.243

I installed brew and only the command line tools, but brew doctor says I need to run xcode-select to set the path - what do I set it to? – qxotk – 2012-06-16T21:46:57.167

According to my system, xcode-select -print-path == /. So I guess set it to the root path. I recall this was part of the problem, it gets set or used to be set to /Developer when the developer tools were installed to /Developer/usr/bin, which changed in the newer version. YMMV. – Rebecca Scott – 2012-06-19T02:44:42.783