Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

[insert screenshot]

3) Let Everyone Know Where XCode Is

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

4) Install X11

Visit http://xquartz.macosforge.org/trac/wiki and download and install 2.7.2+.

You will need to fix the symlink it makes:

ln -s /opt/X11 /usr/X11

5) Reinstall your brews

brew list

Will tell you what you need to check. Try out everything one by one and when one doesn't work brew remove it and then reinstall it. If the install doesn't work, try brew install it --use-gcc to prevent llvm from getting in the way.

Things that gave me issues that I had to remove and install:

  • macvim
  • imagemagick
  • ghostscript

You might need to install libxml2 and link it manually to make sure you don't get the wrong xml2-config if your path:

brew install libxml2  
brew link libxml2

Run brew doctor and fix anything it tells you.

You may also need to symlink gcc for certain ruby gems and other stuff like that:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

Maybe even g++ if you use that:

sudo ln -s /usr/bin/g++ /usr/bin/g++-4.2

You are good to go.

Random links that may help

@mntmn

Hey, thanks for the write-up! So far, I didn't have to install gcc manually (although I have llvm flavored gcc now, so this might have random compatibility problems). Also, I copied XCode.app over the one in /Developer. brew worked fine after installing Command Line Tools in XCode 4.4 and doing brew update.

@myobie
Owner

I wouldn't trust the llvm gcc very much, but if it works it works!

@johntoups

Regarding step 5, above, and the need to install gcc - on a clean 10.8, with a bare Xcode 4.4 install, and it was not a necessary step. Brewing now.

@qwesda

step 5 was also not needed for my installation (upgrade from lion)

@DAddYE

Thanks man!

A quick question, since we had installed command line tools why is necessary add to our paths xcode bin ?

@DAddYE
@chapati23

"my@mail.com does not have access to Command Line Tools" is what i get when i try installing the command line tools from xcode 4.4 after the mountain lion upgrade. that really sucks. does that mean homebrew, from now on, is only gonna work with a paid mac developer account?

@chapati23

downloaded it from developers.apple.com but homebrew still doesn't recognize gcc:

HOMEBREW_VERSION: 0.9.2
HEAD: aefdf7ff8c2e172cf00edc7625c633ccd47e3099
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.8-x86_64
Xcode: 4.4
CLT: 4.4.0.0.1.1249367152
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 4.0 build 421
MacPorts or Fink? false
X11: 2.7.2 @ /opt/X11
System Ruby: 1.8.7-358
Which Perl:   /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby:   /Users/philip/.rvm/rubies/ruby-1.9.3-p194/bin/ruby

so for example "gem install rmagick" fails because it can't find a C-Compiler in ${ENV['PATH']}

@zentrope

I have the same issue as pshizzle above. I have a paid IOS account, but not a paid Mac account, and the Xcode 4.4 version I downloaded via the app store doesn't allow me to download the command line tools. Strange! Is there a way to get them outside of Xcode, or somehow register my account properly?

@uipoet

You can download them directly: https://developer.apple.com/downloads

Look for the last link under Xcode 4.4 section: Xcode 4.4 Command Line Tools for OS X 10.8

This is no longer necessary. Apple has since corrected their account bug. You may now get the latest command line tools from inside the Downloads tab of Xcode once again.

@stephank

@uipoet: I don't see an Xcode 4.4 section there. There's a “Command Line Tools for Xcode - June 2012”, but that won't install on Mountain Lion (only Lion).

@zentrope

I found the right download. Worked. Now "brew doctor" reports a clean bill of health.

@chrismo

I was able to download command line tools from here: https://developer.apple.com/downloads/index.action as others mentioned. The direct link is not accessible outside a valid session.

@voidlily

@chrismo I tried using that link and got an Access Denied error.

@stephank

@chrismo: “Access denied”, I'm afraid.

Right before upgrading to Mountain Lion, I actually upgraded to XCode 4.4 in Lion and installed the command line tools just fine. After the upgrade to Mountain Lion, it seems they're gone and I'm unable to install them again. :/

@chrismo

Hmmm -- yeah, sorry, that was session specific looks like (the dmg link) -- but I just downloaded it within the last half hour.

@adamjgrant

Can someone just put the download on http://ge.tt for us?

I tried logging in but only an older CLI tools download appears. Same problem as @stephank

@iterion

This link worked for me and I'm not a paying developer - you may still need to be signed in though, didn't check that.
http://adcdownload.apple.com/ios/ios_simulator__resigned/cltools_mountainliondp2_march12.dmg

See here:
http://stackoverflow.com/questions/9329243/xcode-4-4-command-line-tools/9964905#9964905

@ericdfields

Thanks @iterion… that worked for me. I tried to curl it first and that didn't work. You definitely need to be signed in and download through a sessioned browser.

@adamjgrant

Oddly enough, @iteron's link works. Here's a mirror in case the link breaks: http://ge.tt/2AqB42L/v/0?c

Thanks!

@miksu

@iterion's link installed fine, but brew doctor now says:

Error: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.

Unsurprisingly, reinstalling Xcode didn't help.

@adamjgrant

Sorry if this is crazy but I actually completely uninstalled xcode when I ran it. It's still not on my machine, maybe try it completely without xcode?

@CDainMiller

This is such a pain in the butt.

@songgao

I upgraded to Mountain Lion before upgrade Xcode. Same issue here as @pshizzle , that I do not have access to the commandline tools. Unfortunately the one on the Apple Developer Tools that is released today doesn't work either. It's for Lion.

@iterion 's link http://adcdownload.apple.com/ios/ios_simulator__resigned/cltools_mountainliondp2_march12.dmg works for me. Now brewing.

Thanks everybody!

@paulmillr

The latest link may be working but it's march release which is probably very buggy.

I've uploaded CLI tools that come with xcode 4.4 GM.

Latest 10.8 dev tools

cltools10_8gmseed6938077a.dmg

@adamjgrant
@adamjgrant
@adambratt

I actually can't see the March one but I can see the latest one...no idea why.

@adamjgrant
@iterion

I doubt that the March release is very buggy. It's just a collection of standard compilation tools, which are fairly stable pieces of software.

@stephank

I just tried installing the normal way through XCode again, and it is now working.

@jedrichards

For the love of God!

Anybody having any luck with paulmillr's ge.tt upload? I'll be installing on a Lion > M Lion upgrade. I was just rolling the old CLTs before the upgrade, would rather not install XCode ...

@jashapiro

Xcode is fixed for me too now.

@NickClark

I've been trying to help a friend with this. It seems to be some kind of account issue on Apple's side.
I can confirm what @uipoet said, the command line tools download is now located under the XCode 4.4 listing on https://developer.apple.com/downloads .
I can login in to the developer downloads and see it there, and XCode also properly downloads it from the Preferences Pane. For my friend, he can't see it in the apple developer download list, nor can he download it in XCode. Odd indeed.

UPDATE - He just tried again and it works.

@adamjgrant

Thanks, Nick. That message wasn't coming across earlier in the thread.

Several people have proclaimed the download is available in the list, but it simply isn't for some people or some of the time as you have revealed. It's not that they're not looking hard enough. That's why I recommended someone just put it on ge.tt, which they did.

It makes the most sense to me for peeps to just use the ge.tt links as those are pretty consistent and doesn't differ by login.

http://ge.tt/3mes23L/v/0?c
http://ge.tt/2AqB42L/v/0?c

Problem solved.

@jedrichards

Yup, I wasn't seeing the XCode 4.4 CLTs on the Apple downloads site at all. I was seeing a pretty recent version for XCode 4.3 (late July), but I understand these don't work with Mountain Lion.

I'm on a newly upgraded XCode-less system (Lion to Mountain Lion) and I installed the version here (http://ge.tt/3mes23L/v/0?c). It seemed to work well, and homebrew started working again. I needed to do an extra step to make all formulas update/install properly (notably node):

sudo xcode-select -switch /usr/bin

See this gist: Homebrew/homebrew#13337 (comment)

These steps have basically straightened out my environment, all without installing XCode.

@alexagui

https://img.skitch.com/20120726-cbppugi2ctbumx5n918h3rb2wx.png

Mountain Lion version of Command Line Tools can be downloaded separately. Look inside the Xcode 4.4 tab.

@jedrichards

No no, some of us aren't even seeing the XCode 4.4 tab at all, so no option to download those command line tools, even as a sub option. Not sure why this is. I'm in the UK and on a non-paying dev account, so maybe that's partly the reason?

@adamjgrant

@alexagui Did you not read https://gist.github.com/1860902#gistcomment-379892 or do you just not believe us?

@nico

The command line tools on developer.apple.com currently don't work on 10.8. You can however use Xcode->Preferences->Downloads and hit install next to "commandline tools" there. That works on 10.8 (tested with xcode 4.4).

@johntoups

Also tested on XC 4.5b3 with internal CLTs.

@tomekw

@myobie for me sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 was needed too (to install json gem, for example).

@boklee

After installing Xcode 4.4, if there is nothing from the Xcode-Preference-Downloads pane, just restart Xcode itself. Then the command line tool appears in the list.

@esilvas

So far, this has been a BIG help. Thanks!

@freshfey

@tomekw that solved my problem, thanks.

@myobie
Owner

I've updated the gist with what worked for me and added some of the other links that people have posted.

@Panajev

sudo xcodebuild -license

this step might be necessary sometimes too.

@jmagnusson

Seems that the august update for the command line tools just landed: https://developer.apple.com/downloads/index.action

@ns-1m

Symbolic link in brew link does not work.

######
Nolis-MacBook-Pro:GEOS nsicad$ brew install spatialindex
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
==> Downloading http://download.osgeo.org/libspatialindex/spatialindex-src-1.7.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/spatialindex-1.7.1.tar.gz
==> ./configure --prefix=/usr/local/Cellar/spatialindex/1.7.1 --disable-debug
==> make
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link spatialindex'
==> Summary
/usr/local/Cellar/spatialindex/1.7.1: 40 files, 2.8M, built in 28 seconds
Nolis-MacBook-Pro:GEOS nsicad$ brew list
boost geos libtool pkg-config sip spatialindex
Nolis-MacBook-Pro:GEOS nsicad$ brew link spatialindex
Linking /usr/local/Cellar/spatialindex/1.7.1...
Error: Could not symlink file: /usr/local/Cellar/spatialindex/1.7.1/lib/pkgconfig/libspatialindex.pc
/usr/local/lib/pkgconfig is not writable. You should change its permissions.
Nolis-MacBook-Pro:GEOS nsicad$

@rafaelrinaldi

This is quite helpful! Thanks for it.

@RudthMael

You may need to symlink g++ too.

sudo ln -s /usr/bin/g++ /usr/bin/g++-4.2

@Pixxel-br

Thanks man

@andrewsheelan

sudo ln -s /usr/bin/gcc /usr/bin/g++-4.2

@ekinertac

i just added your gist an screenshot, would you like to fork it ? https://gist.github.com/4004926

@myobie
Owner

Added a not about g++, thanks @RudthMael and @andrewsheelan.

@ekinertac your screenshot is not showing up for me.

@Rogerio

The best part of your advices was: Reinstall your brews

Today, I ran into all sorts of problems with brew and reinstall my packages and reinstall made the trick.

Even a problema I was having with imagemagick and paperclip.

Thank you! I mean it, thank you!

@sfsekaran

It was suggested by various blogs to install homebrew's version of gcc-4.2:

brew tap homebrew/dupes && brew install apple-gcc42

RVM will use the brew installed version over the LLVM version.

@StevenClontz

If you'd like a screenshot, here you go: http://i.imgur.com/NksrHjH.png

Thanks for this!

@ibadukefan

When I get to step 5 I get the error, "-bash: brew: command not found"
Any ideas?

@mcella

Here you can find a very useful script to download CLT:

https://gist.github.com/uchida/3559987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.