Mindaugas Jačionis Mindaugas Jačionis - 1 year ago 247
Git Question

Homebrew install fails while copying files

I run this:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

I get prompt:

==> This script will install:

After I click "return"(enter button) I get this error:

==> Downloading and installing Homebrew...
fatal: cannot copy '/usr/local/git/share/git-core/templates/hooks/pre-receive.sample' to '/usr/local/Homebrew/.git/hooks/pre-receive.sample': Permission denied
Failed during: git init -q

Any ideas what kind of error I am facing and what can be done? It is not really clear for me as it is first time I am facing something like this.

Answer Source

You are getting permission denied when downloading the files into /usr/local.

This folder often belongs to root. This is a known issue with brew. Fix it by doing

sudo chown $(whoami) /usr/local

and then re-run the installer.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download