Home > 10.7.3, homebrew, xcode > Installing git on Mac OS X Lion through Homebrew error fix

Installing git on Mac OS X Lion through Homebrew error fix

I recently did a fresh 10.7.3 installation onto an i5 hackintosh and installed Xcode on it through the app store. Then I installed my favorite tool homebrew through this one-line command. Everything went well except when I tried to install git (actually any brew install command would fail regardless the package) through homebrew I got the following error:

Error: Failed executing: make prefix=/usr/local/Cellar/git/ CC=/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc CFLAGS=-Os

A little digging shows that file /usr/bin/make is missing, further digging reveals that the new Xcode makes the command line tools one of the optional components so in order to use homebrew, the command line tools must be installed via Xcodes -> Preferences -> Downloads -> Command Line Tools -> Install. brew install package_name works like a charm again like it used to on 10.7.2 once command line tools is installed.

Screenshot (after Xcode Command Line Tools is installed):


[UPDATE 2/19/2012] Additional note on installing redis with homebrew:
brew install redis would fail, even with Command Line Tools component installed, for now you need to use option --llvm to install redis:
brew install redis --use-llvm
Solution is found through https://github.com/mxcl/homebrew/issues/10305.

Categories: 10.7.3, homebrew, xcode
  1. February 19, 2012 at 3:13 am

    Ran into this issue today. Thanks for the post.

    • ricoch3n
      February 19, 2012 at 7:57 am

      No problem, glad it helps.

  2. Daniel Davidson
    February 19, 2012 at 11:53 pm

    Many thanks for the info. Brew is awesome but I couldn’t work out what the issue was, everything is working great now.

  3. giorgenes
    February 20, 2012 at 10:58 am

    works for me. thanks

  4. February 21, 2012 at 6:15 pm

    I had to do this first to get homebrew to work: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

    Found on the github discussion that homebrew pointed me to while failing to install mercurial https://github.com/mxcl/homebrew/pull/10314

  5. February 22, 2012 at 6:41 pm

    Awesome.. Had no idea why i couldn’t get this to work before I saw your post. Works perfectly now. Thanks for the post!

  6. February 22, 2012 at 7:24 pm

    Saved me a lot of time – thanks!!

  7. stefmikhail
    April 4, 2012 at 6:52 am

    What’s included in the Command Line Tools? Make, and what else?

    • ricoch3n
      April 5, 2012 at 5:35 am

      Might be just a bunch of cli commands that make compiling in the Terminal possible. I don’t have the list of the tools that come with it, nor could I find it from Apple’s website.

  8. Mei
    June 1, 2012 at 10:51 pm

    Thanks for the post. It’s been bugging in the last couple of days.

  9. June 24, 2012 at 2:26 pm

    Thanks, Rico. Appreciate you publishing this fix

    • ricoch3n
      June 27, 2012 at 2:57 am

      No problem Adrian.

  10. June 25, 2012 at 3:10 pm

    Thank you, this saved my day.

  11. christian
    July 2, 2012 at 7:15 pm

    thanks – this helped me out.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: