1
votes

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.

1
Delete the homebrew data and try reinstalling it. Don't use any brew commands until reinstalled.hunterboerner
I've tried that, I'll remove all the folders and reinstall it, but once I try brew doctor after the installation I get the error again.Zach
What are the permissions set on /bin?hunterboerner
I'm not sure, how would I check?Zach
ls -la / and in /binhunterboerner

1 Answers

0
votes

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.