Homebrew saying Xcode is outdated

XcodeCommand LineHomebrew

Xcode Problem Overview


I'm trying to perform an install of a package with Homebrew, but when I try to run the install I am getting the following error:

> Error: Your Xcode (7.3.1) is outdated. Please update to Xcode 8.0 (or delete it). Xcode can be updated from the App Store.

I would like to keep Xcode 7.3.1 on this machine since I have Xcode 8 on another machine, and am using this one for older projects.

I have found a similar post on SO, but the recommended solution to set export TRAVIS=1 doesn't seem to work for me. Hoping someone has a fix or a workaround I may use. Here are some more of my specifics:

Xcode 7.3.1
Homebrew 1.0.8-135-g4284b82
macOS Sierra 10.12 (16A323)

If anything other specifics needed, please let me know.

Thanks guys!

Xcode Solutions


Solution 1 - Xcode

So as @NicolasMiari mentioned in a comment above, the fix to my issue ended up having to have both Xcode 7 and Xcode 8 on my machine. I went on the apple developer site, downloaded Xcode 8, saved it to my documents and then used:

sudo xcode-select -switch ~/Documents/Xcode.app/

and then ran my brew install which worked as expected. Afterwards I ran:

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

to switch back to Xcode 7.3.1.

Hope this helps someone else, and thanks for the suggestions.

Solution 2 - Xcode

Just do as this

Open the file /usr/local/Homebrew/Library/Homebrew/extend/os/mac/diagnostic.rb ,

then delete this line check_xcode_minimum_version in the following function.

def fatal_build_from_source_checks
	%w[
	  check_xcode_license_approved
	  check_xcode_minimum_version
	  check_clt_minimum_version
	  check_if_xcode_needs_clt_installed
	].freeze
	end

Then brew install works fine.

Solution 3 - Xcode

  1. according to https://github.com/Homebrew/brew/issues/4957 outdated home-brew could cause this problem, brew update-reset fix it.

  2. if step 1 does not work, reinstall homebrew with /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Solution 4 - Xcode

Renaming worked for me:

Xcode -> Xcode-old
Xcode-beta -> Xcode

Solution 5 - Xcode

Two options:

  1. The best option is to update your xcode first, then follow @George H's recommendation above:

> So as @NicolasMiari mentioned in a comment above, the fix to my issue ended up having to have both Xcode 7 and Xcode 8 on my machine. I went on the apple developer site, downloaded Xcode 8, saved it to my documents and then used: > > sudo xcode-select -switch ~/Documents/Xcode.app/ > > and then ran my brew install which worked as expected. Afterwards I ran: > > sudo xcode-select -switch /Applications/Xcode.app/ > > to switch back to Xcode 7.3.1.

  1. Set the xcode-select to the path of your CommandLineTools.

    sudo xcode-select --switch /Library/Developer/CommandLineTools
    

    As explained here, .Homebrew without Xcode

Both options work well.

Solution 6 - Xcode

Run this code in terminal

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null

Then try running below code,

brew install jenkins

Hope this solves

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGeohernaView Question on Stackoverflow
Solution 1 - XcodeGeohernaView Answer on Stackoverflow
Solution 2 - XcodejcccnView Answer on Stackoverflow
Solution 3 - XcodeJichaoView Answer on Stackoverflow
Solution 4 - XcodeWhitney FosterView Answer on Stackoverflow
Solution 5 - XcodeOlusola OmosolaView Answer on Stackoverflow
Solution 6 - XcodesurendherView Answer on Stackoverflow