Reputation: 1
Did a fresh install of Mavericks from a clean disk, installing Homebrew before updating my Ruby versions with rbenv. Getting this error:
error: unable to create file bin/brew (Permission denied)
error: unable to create file share/man/man1/brew.1 (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
Failed during: git reset --hard origin/master
Any suggestion appreciated.
Upvotes: 0
Views: 1600
Reputation: 3235
There are a few things you can do to fix, some of which I don't really recommend as they change permissions of folder and could eventually lead to other issues.
Run as superuser: sudo ruby -e "$(curl -fsSL
https://raw.github.com/Homebrew/homebrew/go/install)"
That should force it to run, but may give it the wrong permissions.
Ensure there are no other competing installs of homebrew. Check /usr/local
for a directory called Cellar
. Also ensure there aren't any existing scripts either in the /usr/local/bin
or /usr/local/share/man/man1/
directories. A quick sanity check is to run which brew
and see if it returns a location. If any of those do exist, remove and try to reinstall.
Change the permissions of the /usr/local
directory. I've done this for npm before but it's mostly bad idea as the rest of the system may depend on what those permissions are without warning. To do this, run the following command, probably as the superuser (using sudo):
chown $USER -r /usr/local/
Upvotes: 1