Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew update broke something?

Tags:

homebrew

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.

like image 356
Poyi Avatar asked Sep 02 '12 23:09

Poyi


People also ask

What does brew update reset do?

The update-reset version of this command resets all formulae to be identical to the contents of their remote repositories, deleting any local changes. It is only used as a last-resort effort to fix a problem (it's like unplugging Homebrew and plugging it back in).

Does brew update packages automatically?

An easy, convenient way to automatically update Homebrew. This script will run brew update in the background once every 24 hours (by default) until explicitly told to stop, utilising launchd . brew upgrade and brew cleanup can also be handled automatically but are optional flags.

How long does it take to update brew?

From 20 minutes to an hour. The devs are aware.


2 Answers

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

like image 115
RNA Avatar answered Oct 29 '22 18:10

RNA


Do brew doctor

Examine the output and follow any recommendations given.

like image 22
Michael Durrant Avatar answered Oct 29 '22 17:10

Michael Durrant