OSX Homebrew error: uninitialized constant MACOS

homebrew, macos

Solution

The `MACOS` constant is set in `globals.rb`. It seems like you may have a borked installation of Homebrew.

Check the output of `brew doctor` for any suggestions.

If that doesn't help please update with the results of `brew --config`.

If all else fails you may want to try re-installing Homebrew.

UPDATE:

Since this was a previous user's machine make sure your user is the owner of /usr/local and everything within. Fix it with `sudo chown -R $USER /usr/local`.

Problem

I've searched around a bit and can't seem to find any record of anyone else with this problem. Whenever I try to run ``` $ brew update ``` I am rewarded with ``` /usr/local/bin/brew:34: uninitialized constant MACOS (NameError) ``` This isn't my machine and I normally develop on Linux systems so this is all a bit odd to me. Any help would be greatly appreciated! Please tell me if there is any additional info I should provide. Again, I'm not used to homebrew or OSX. EDIT at the request of JameA ``` xiao:~ patrick$ brew doctor /usr/local/bin/brew:34: uninitialized constant MACOS (NameError) xiao:~ patrick$ brew --config /usr/local/bin/brew:34: uninitialized constant MACOS (NameError) ``` ...Not sure I like this whole "here, use this macbook for the project, it works better" thing...

Original source