Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew is generating two warnings

I use Homebrew as the package manager. I run this command:

brew update

But I got this error:

error: unable to unlink old 'bin/brew' (Permission denied)

Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master

Running again under sudo:

/usr/local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG error: The following untracked working tree files would be overwritten by checkout:

.gitignore
;;; big list goes here ;;;;

And now, every brew command generates these warning:

/usr/local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG

Any idea what is going wrong?

like image 748
Chiron Avatar asked Mar 26 '11 02:03

Chiron


2 Answers

It sounds like half of it updated before it errored out, and now it's in a bad state. You may want to

cd /usr/local && git reset --hard HEAD

That should reset all git-controlled files (e.g. homebrew) back to their pristine versions. You may need to sudo that git command. After that, you can attempt to fix the permissions however you want (this may be as simple as running sudo chown -R yourname:staff /usr/local if no files in that dir need to be owned by someone else).

like image 81
Lily Ballard Avatar answered Oct 18 '22 07:10

Lily Ballard


Make sure that /usr/local/bin has write permissions for the user account.

like image 22
Clayton Stanley Avatar answered Oct 18 '22 08:10

Clayton Stanley