Install Homebrew on Mojave get error Not a directory - xcode

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

Related

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.

Why am I missing a system file relating to Ruby on OSX 10.10.5?

I'm trying to install Homebrew on my Mac running OSX 10.10.5 with the following script…
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
…but am getting the following error in the terminal:
/usr/local/Library/ENV/scm/git: line 10: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/ENV/scm/git: line 10: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
/usr/local/Library/ENV/scm/git: line 10: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/ENV/scm/git: line 10: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
/usr/local/Library/brew.sh: line 250: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/brew.sh: line 250: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
Failed during: /usr/local/bin/brew tap homebrew/core
This error also appears after running any brew command.
I can run Ruby 2.0.0p481, and have Xcode Version 7.2.1 (7C1002) installed, which is the latest version available to me. I'm also able to uninstall Homebrew using this script with no errors:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Originally, I thought it was a permissions issue, so have tried…
sudo chown -R $(whoami) /usr/local
…with no success.
I then searched for the path mentioned in the error. Current shows as an alias, and when I attempt to open it, I get the following error:
The operation can’t be completed because the original item for “Current” can’t be found.
I can navigate to the /usr/bin/Ruby path through the Finder, but am unsure whether this relates to the path in the error.
I don't believe I've touched the Ruby installation, so I'm unsure why there's an error.
The Terminal now shows the following upon opening a Terminal window:
-bash: rbenv: command not found
-bash: rbenv: command not found
-bash: rbenv: command not found
My ultimate goal is to compile and install Tiled Map Editor on my Mac running OSX 10.10.5. I had previously installed Homebrew, so followed the instructions for compiling Tiled Map Editor, which is when I came across the problem.
I haven't found out why I'm missing a system file, but rather than reinstall the whole OS, I followed the instructions found in this answer to reinstall Essentials from the Yosemite installer, which includes Ruby.
Homebrew now installs as expected.

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.

Tried installing MongoDB with brew and it says "Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)"

Using Mac OSX 10.10.4 on 13' Macbook Air
Typed in 'brew update' like the Mongo docs said and it updated
Then typed 'brew install mongodb' and it took ages to say
Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)
This is what the console said leading up to that point, in case this helps:
Joshuas-Air:~ Josh$ brew install mongodb
==> Downloading https://homebrew.bintray.com/bottles/mongodb-3.0.4.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mongodb-3.0.4.yosemite.bottle.tar.gz
Error: Permission denied - /usr/local/etc/mongod.conf
Warning: Bottle installation failed: building from source.
==> Installing mongodb dependency: scons
==> Downloading https://homebrew.bintray.com/bottles/scons-2.3.5.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring scons-2.3.5.yosemite.bottle.tar.gz
🍺 /usr/local/Cellar/scons/2.3.5: 208 files, 2.4M
==> Downloading https://fastdl.mongodb.org/src/mongodb-src-r3.0.4.tar.gz
######################################################################## 100.0%
==> Cloning https://github.com/mongodb/mongo-tools.git
Updating /Library/Caches/Homebrew/mongodb--github.com-mongodb-mongo-tools--git
==> Checking out tag r3.0.4
==> ./build.sh
==> /usr/local/opt/scons/bin/scons install --prefix=/usr/local/Cellar/mongodb/3.0.4 -j4 --osx-version-min=10.10 --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --use-new-tools
Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)
Joshuas-Air:~ Josh$
Any help at all would be appreciated.
I had mostly the same error. I could not solve the problem by chown'ing the /usr/local directories as the prompts suggest possibly due to my upgrade to High Sierra. I was able to succeed installing mongodb by reinstalling homebrew using the following command:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
This allowed my subsequent brew install mongodb to work.
I had the same problem, changing the directory permissions didn't work for me so eventually I've found this solution:
Download the most recent version (.tgz).
Open the terminal and head to the ~/Downloads folder or wherever you saved the file.
Untar: tar xvf filename.tgz.
Enter the directory and go to the bin directory.
At the terminal use the sudo bash (become root) command.
Now enter the command cp * /usr/local/bin.
Create /data/db directories (optional, this is the default location MongoDB uses).
At the terminal use the command exit to exit root user.
which mongo should now respond with /usr/local/bin and you are all set to go.
My guess is that the permissions on the folder /usr/local/ are not set 755 or 777.
You can change the permissions or simply try to run the command as root:
sudo brew install mongodb

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