brew doctor bad interpetor no such file - macos

I haven't tried using brew since upgrading from Mavericks to Yosemite. I'm getting the following error.
legion:~ jkratz$ brew doctor
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0

Would you have anything against running the uninstaller script and starting again? Looks like ruby has moved and it can't find it.

You haven't run brew upgrade in a while and Apple upgraded their Ruby!
To fix, do cd /usr/local && git pull and you should be fine.

Related

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.

Homebrew broken? Ruby Broken? Can't run brew or reinstall

I can't run anything in brew. I do not know what has happened. I tried to install Jekyll and I started getting this error.
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0
Also, ruby version: ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Here is what I typed:
~]$ brew install ruby (gh-pages✱)
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0
Try switching over to rbenv to install and manage your ruby:
$ brew update
$ brew install rbenv ruby-build
Afterwards you'll still need to add eval "$(rbenv init -)" to your profile. You'll only ever have to do this once.
$ rbenv install 2.0.0p481
https://github.com/sstephenson/rbenv#homebrew-on-mac-os-x

Completely broken Homebrew install, getting weird error upon reinstall

I'm trying to reinstall Homebrew and the installation is successfull up to when I try typing 'brew doctor' to which I receive this message:
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0
I definitely think this may be something wrong with one of my .profile files, but I can't seem to figure out what to do. I've manually compiled Ruby because I accidentally screwed that installation up, and I've installed RVM.
In RVM, running 'rvm install ruby' gives me the same error as above, along with this one below:
ERROR: '/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.
I've tried to run
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
to delete Homebrew but I get the same error as listed above.
I've spent a few hours trying to solve this mess but I'm getting no where and just cluttering my system with broken installations. Any advice on how to finally solve this would be greatly appreciated.
I ran into the same problem. The program /usr/local/Library/brew.rb calls an old version of the ruby interpreter, that no longer exists due to a recent MacOS X upgrade:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Change that to:
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
Then run:
$ brew update
You will have to clean up a bunch of git related problems in /usr/local/Library, basically you need to make a commit of your changed version of brew.rb, but there may be other things git will complain about. I was able to salvage my brew installation in this manner.

Error installing Homebrew on OS X

I'm attempting to install Homebrew, but I'm running into some issues. I listed the result below. How can I fix this problem?
$ ~ $ brew install wget
==> Downloading http://ftpmirror.gnu.org/wget/wget-1.14.tar.gz
Already downloaded: /Library/Caches/Homebrew/wget-1.14.tar.gz
==> ./configure --prefix=/usr/local/Cellar/wget/1.14 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri
checking whether make sets $(MAKE)... ./configure: /usr/local/Library/ENV/4.3/sed:/bin/bash^M: bad interpreter: No such file or directory
no
configure: error: cannot run /bin/sh build-aux/config.sub
./configure: /usr/local/Library/ENV/4.3/sed: /bin/bash^M: bad interpreter: No such file or directory
./configure: /usr/local/Library/ENV/4.3/sed: /bin/bash^M: bad interpreter: No such file or directory
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Note: I uninstalled MacPorts beforehand and brew doctor works without a hitch.
Solved: I settled with an alternate installation method ("Untar anywhere") that I found on the Homebrew wiki page.
What I ran: mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew
/bin/bash^M is your clue. For some reason there's a DOS line-end character in what's being downloaded. This is probably an error in the formula, but if you're adventurous, you can brew install dos2unix and then run dos2unix on the folder in question.
You are using Windows style end-of-line in Unix/Linux/Mac OS X. If you modified your Git core.autocrlf attribute before, then try:
git config --global core.autocrlf input
Then reinstall Homebrew.

Failing while running `brew install

I am trying to re-install Nokogiri dependencies with homebrew following the steps described here. I had nokogiri working fine before, but had to remove macports to make some space on my mac.
Running into errors at the first step:
$ brew install libxml2 libxslt
Warning: Your Xcode (3.2.2) is outdated
Please install Xcode 3.2.6.
==> Downloading ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
Warning: Failed to create the file
Warning: /Library/Caches/Homebrew/libxml2-2.8.0.tar.gz
0.0%
curl: (23) Failed writing body (0 != 1448)
Error: Download failed: ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
Any idea how to fix this?
Is the warning about Xcode version significant?
The relevant message above seemed to be Warning: Failed to create the file.
Tried to create the /Library/Caches/Homebrew/libxml2-2.8.0.tar.gz file manually, and got a Permission denied error.
Changed the ownership of the folder to my username:group with
sudo chown <username>:<group> /Library/Caches/Homebrew/
With that change, the brew install step worked successfully!
Note: The answers to brew install mongodb error: Cowardly refusing to `sudo brew install' Mac OSX Lion helped in figuring out the problem.

Resources