Faysal
Faysal

Reputation: 101

Home-brew installation fails on High Sierra

I am trying to install Homebrew on a Mac mini with High Sierra v10.13. I run the following command as instructed:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The terminal informs me that it will install brew and asks password, but it eventually fails and shows the following message:

The operation couldn’t be completed. (NSURLErrorDomain error -1012.)
==> Installing 
==> /usr/bin/sudo /usr/sbin/softwareupdate -i 
Software Update Tool
: No such update
No updates are available.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools

Please help me solve this issue. Thanks.

Upvotes: 4

Views: 5547

Answers (2)

labmana
labmana

Reputation: 41

I had a similar problem, so I am posting this here to help anyone in pain !

The command brew doctor tells me that some installed formulae are missing dependencies.

After doing the command brew upgrade, I get the error for some dependencies (below is the example for openjdk) :

configure: error: No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK
/private/tmp/openjdk-20200219-89506-1wim844/jdk13u-jdk-13.0.2+8/build/.configure-support/generated-configure.sh: line 82: 5: Bad file descriptor
configure exiting with result code 1

These open issues may also help:
Migrate formulae to depend on `openjdk`.

Here is how I solved this :

  • sudo xcode-select -r
  • Edit and set the date of your Mac as October 1st, 2019
  • sudo xcodebuild -runFirstLaunch
  • sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  • brew upgrade

And it worked ! (i am using a iMac mid2011 with MacOS Sierra)

Upvotes: 4

Faysal
Faysal

Reputation: 101

I managed to solve it with help from a senior programmer. The error was due to absence of Xcode Command Line Interface even though it was showing present in Xcode>>preference>>Location>>Command Line Tools.

So, I had to manually download the Command Line Interface dmg file from my Apple Accounts download section and install it.

Upvotes: 1

Related Questions