Error installing Homebrew

2019-08-01 00:43发布

问题:

I am trying to install Homebrew on my system with the command mentioned on their homepage

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

but it's giving me following error -

-e:67: warning: Insecure world writable dir /usr/local in PATH, mode 040777
-e:96: warning: Insecure world writable dir /usr/local in PATH, mode 040777
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

If I try to do cleanup, it says that it can't find brew command. I'm clueless here as to if I have it installed on my machine why can't I run any of the brew commands.

回答1:

Run this:

xcode-select --install
rm -rf /usr/local/Cellar /usr/local/.git
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"


回答2:

Sounds like if you were to do an ls -al /usr you'd see that the local directory is drwxrwxrwx ... Have you tried chmod 775 /usr/local (that may or may not need sudo prepended).

Also, is brew installed in /usr/local/bin/brew? Or somewhere else?