Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

@jedrichards
Copy link

jedrichards commented Jul 26, 2012

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/legacy-homebrew#13337 (comment)

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

@alexagui
Copy link

alexagui commented Jul 26, 2012

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
Copy link

jedrichards commented Jul 26, 2012

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
Copy link

adamjgrant commented Jul 26, 2012

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

@nico
Copy link

nico commented Jul 26, 2012

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
Copy link

johntoups commented Jul 26, 2012

Also tested on XC 4.5b3 with internal CLTs.

@tomekw
Copy link

tomekw commented Jul 27, 2012

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

@boklee
Copy link

boklee commented Jul 27, 2012

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
Copy link

esilvas commented Jul 28, 2012

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

@freshfey
Copy link

freshfey commented Jul 30, 2012

@tomekw that solved my problem, thanks.

@myobie
Copy link
Author

myobie commented Jul 30, 2012

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

@Panajev
Copy link

Panajev commented Aug 3, 2012

sudo xcodebuild -license

this step might be necessary sometimes too.

@jacobsvante
Copy link

jacobsvante commented Aug 7, 2012

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

@ns-1m
Copy link

ns-1m commented Aug 10, 2012

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
Copy link

rafaelrinaldi commented Sep 12, 2012

This is quite helpful! Thanks for it.

@rgalite
Copy link

rgalite commented Sep 13, 2012

You may need to symlink g++ too.

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

@Pixxel-br
Copy link

Pixxel-br commented Oct 1, 2012

Thanks man

@andrewsheelan
Copy link

andrewsheelan commented Oct 25, 2012

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

@ekinertac
Copy link

ekinertac commented Nov 2, 2012

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

@myobie
Copy link
Author

myobie commented Dec 11, 2012

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

@ekinertac your screenshot is not showing up for me.

@Rogerio
Copy link

Rogerio commented Dec 13, 2012

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
Copy link

sfsekaran commented Jan 4, 2013

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
Copy link

StevenClontz commented Feb 5, 2013

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

Thanks for this!

@ibadukefan
Copy link

ibadukefan commented Feb 28, 2013

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

@mcella
Copy link

mcella commented Apr 16, 2013

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

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

@Kiodaddy
Copy link

Kiodaddy commented Jun 20, 2017

is this a joke or what ?

@shape55
Copy link

shape55 commented Sep 16, 2018

I went thru all the above steps for 10.8.5 but when I went to install Homebrew it gives me this error:

Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/brew/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force

I tried researching this error but couldn't find anything relevant to my specific issue. I also made sure I had curl installed as that was mentioned in some of the feedback I reviewed, and I have this:

curl 7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8} zlib/1.2.5

The only issue I ran into along the way was with X11, where I got a "Permission Denied" error after entering "ln -s /opt/X11 /usr/X11". However, I installed the latest version of it, which is 2.7.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment