xcode-select command not found - xcode

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.

Related

Brew installation - not a valid reference error

I am trying to install homebrew on macos m1 chip, with the one-line command but keep running into the following error. Could someone please help me to fix this? Thank you.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
Press RETURN to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R miththinda:admin /opt/homebrew
==> Downloading and installing Homebrew...
HEAD is now at a0ae4a7a0 Merge pull request #12658 from sjackman/sj/linkage-checker
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Removing the directory and trying to reinstall worked for me.
sudo rm -rf /opt/homebrew
Please run the following commands in your terminal:
rm -fr $(brew --repo homebrew/core) # because you can't `brew untap homebrew/core`
brew tap homebrew/core
You can check the details of the issue here.
Had a similar issue on Mac, I uninstalled it first by typing the command below and I installed Xcode, it worked for me after running the install command again.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
I first installed it onto my Linux system using the command recommended on the homebrew install page:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
but it seem to take a long time, and "hung" showing the output:
Resolving deltas: 100% (793706/793706), done.
for quite a while. I was impatient and killed the process then, and tried the install again. That is when I got the error reported by the OP. The fix was to uninstall the partially installed homebrew, and install again:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

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

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.
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.

Homebrew Installation

so i was trying to install ruby and i heard homebrew was the easiest way to do so. However when i tried to install nothing seemed to happen, heres what i put in the terminal.
Last login: Wed Jul 20 20:37:17 on ttys011
Archie-Hyndmans-MacBook-Air:~ moo$ /usr/bin/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/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
Press RETURN to continue or any other key to abort
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:
sh: fork: Resource temporarily unavailable
==> Installing
==> /usr/bin/sudo /usr/sbin/softwareupdate -i
Software Update Tool
Copyright 2002-2015 Apple Inc.
I am unsure if this means its done or still doing anything or if theres something wrong, apologies if this is a bad question but i have been searching everywhere for an answer.

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.

Resources