Some of you web developers; like me. Upgraded to OS X El Capitan in the last few hours and then realized that it broke your homebrew setup; crap! If you got the following error while running brew update && brew upgrade –all && brew cleanup && brew prune && brew doctor, you’re not alone:

As of July 21st, 2017 this guide is deprecated.

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool

Fear no more and save some time by not asking the ‘oracle’ (Google) on how to fix it, just run the following command in your terminal and you’re good to go:

sudo xcode-select -switch /Applications/

Note: By running the ‘sudo’ command you will need administrative privileges to run it, if you’re an admin just enter your password.

It’s that simple! Just to keep things tidy in your dev environment, close your terminal, re-open it and run this command again. Yes, I know by entering the following also works source ~/.bash_profile and source ~/.zshrc, but I always like to refresh the terminal application as well:

brew update && brew upgrade --all && brew cleanup && brew prune && brew doctor

Everything should be fine moving forward, if you receive any homebrew errors after running brew doctor just follow the error output to fix it. Cheers!