问题
Homebrew was working fine and normal till I did a brew update (haven't update for months). After brew update was finished, every brew command results in the same/similar error message:
/usr/local/Library/Homebrew/global.rb:6:in `require': no such file to load -- set (LoadError)
from /usr/local/Library/Homebrew/global.rb:6
from /usr/local/bin/brew:17:in `require'
from /usr/local/bin/brew:17
I checked the directory and it seems like the homebrew files are there. It is just not loading the file for some reason. I did a reinstall using git since brew command doesn't work. But still got the same error.
Any help on how I may resolve this issue is much appreciated. I might have to reinstall the os if I can't figure out anything.
Update: I did a clean install of the OS. Wasn't able to find a solution without reinstalling.
回答1:
I have met the same problem. And the following solved it:
sudo chown -R $USER:admin /usr/local
cd /usr/local
git reset --hard origin/master
brew update
see https://github.com/mxcl/homebrew/issues/19140
回答2:
Do brew doctor
Examine the output and follow any recommendations given.
来源:https://stackoverflow.com/questions/12240683/brew-update-broke-something