Home-brew installation fails on High Sierra - xcode

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.

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)

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.

Related

Install Homebrew on Mojave get error Not a directory

I try to install Homebrew on macOS Mojave, I ran this command
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and I got this error
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch
/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:****
touch: /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress: Not a directory
Failed during: /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
and one more thing I downloaded Xcode Command Line Tools file and I tend to install on my macOS but I got failed messages from package installer.
Yours
Reza Dehnavi
Your error is caused by the firewall of macOS interfereing in Mojave with the updates process, it is not as other stated due to

Brew Install Error Xcode alone is not sufficient on Sierra

I'm attempting to install a package on Mac OSX Serra v10.12.6 running xCode v9.1 using HomeBrew v1.3.8.
The install and error is
TS-Mac-Pro > brew install dos2unix
Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
xcode-select --install
Then I run the command
xcode-select --install
which says the command line tool package is not available from the software update server.
Which I go into xCode it shows that the command line tools are installed.
TS-Mac-Pro > xcode-select -p
/Applications/Xcode.app/Contents/Developer
Any help would be much appreciated.
Theo
I went to Apple Developer website and downloaded the Command Line Tools dmg directly. An Apple account first needs to be setup.
The Command Line Tools can be found under -
https://developer.apple.com/download/more/
Install downloaded dmg and volia - HomeBrew is back up and running.
I just fixed this issue by deleting the current install of the command line tools and reinstalling them. See commands below:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
This fixed the issue for me in the end

xcode-select error while trying to install Homebrew on macOS Sierra

While trying to install Homebrew on macOS Sierra:
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
Yes , i have solved this error by using following steps.
In your terminal write command ::  xcode-select --install
after doing step no 1 you will get one popUp , so click on install
I had the same error and the only way I could get around it was to install the Xcode command line tools manually by downloading them directly from developer.apple.com. Once installed the brew install worked without issue.
The easiest way to handle this issue is to run:
xcode-select --install
Unfortunately I can’t make comments, so I’ll post it as an answer:
If selecting the correct Xcode version for Homebrew is what you are trying to achieve, then try this:
For Xcode release:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
For Xcode beta:
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
I resolved this error by installing the latest version of Xcode.
I tried installing Command Line Tools manually, but Command Line Tools get failed while installing. Reinstalling XCode did not help at all.
So I attempted below command helped me resolve this error on Big Sur 11.2.1 (20D74)
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Installing Homebrew on Yosemite 10.10.5 error

I tried to Find an answear with this problem
but I could so here it is
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> Installing the Command Line Tools (expect a GUI popup):
==> /usr/bin/sudo /usr/bin/xcode-select --install
Password:
sudo: /usr/bin/xcode-select: command not found
Failed during: /usr/bin/sudo /usr/bin/xcode-select --install
I didnt understand the problem with the xcode
but didt kite get so hope you can help me with this
before hand every try its appricieted
Open Xcode. It might be that u need to accept terms and conditions.
Did you install Xcode command line tools?
$ xcode-select --install
An important dependency before Homebrew can work is the Command Line Tools for Xcode.

xcode-select command not found

I was trying to install homebrew on my mac but failed with the error message saying that xcode-select command not found. I did some searchings online and realized that there is one duplication online. However, it doens't provide me a solution. Below is the information about my environment and settings.
I have xcode5.1.1 and xcode6beta6 both installed on the osx mavericks.
I checked the PATH variable by "echo $PATH" and the result is "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin".
I downloaded the command line tool from the apple download page and installed it.
Last, I run the command "ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" to install the homebrew.
Results I got:
"==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==> Installing the Command Line Tools (expect a GUI popup):
==> /usr/bin/sudo /usr/bin/xcode-select --install
sudo: /usr/bin/xcode-select: command not found
Failed during: /usr/bin/sudo /usr/bin/xcode-select --install
"
I have spent a whole day trying to solve the problem. Anyone please help. A lot of thanks.

Resources