homebrew error: “invalid active developer path” after upgrade to OS X El Capitan

Today, after having tried to update brew on the OS X El Capitan for the first time after the OS X upgrade, I got the following error:

$ brew update
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git checkout -q master

Why? Zero ideas! I really don’t know the reason of that. Anyhow, to fix it you can follow the below steps.

You should install xcode (if you haven’t already done that) and you can do it through terminal:

sudo xcode-select --install

then you should specify that Xcode have to use for command line developer tools:

sudo xcode-select -switch /

If required by a message on terminal, it might be necessary to change permission on the /usr/local directory:

sudo chown -R $(whoami):admin /usr/local

Tht’s all!! GWH!

About Francesco Serafin

I am a PhD student at the Department of Civil, Environmental and Mechanical Engineering at the University of Trento. My two greatest loves: Computer Science and Water (take three with my Lenovo!:D). As a result, the aim of my life is to make both passions coexist. My gpg public key available at https://pgp.mit.edu

Leave a Reply

Your email address will not be published.

*