我曾经安装过Homebrew,但是在某些时候它已经坏了,所以我尝试重新安装它。 我试过跑:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
它给了:
-e:70: 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
(我不知道为什么它说安装了,运行brew给出了“zsh:command not found:brew”) 所以我尝试了运行:
zsh: command not found: brew
然后我尝试在没有brew clean-up
的情况下运行它。哪个执行了。我重新跑了:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
它开始下载和安装,直到达到这一点:
Downloading and installing Homebrew...
remote: Counting objects: 226839, done.
remote: Compressing objects: 100% (59610/59610), done.
remote: Total 226839 (delta 165997), reused 226815 (delta 165979)
Receiving objects: 100% (226839/226839), 52.14 MiB | 135.00 KiB/s, done.
Resolving deltas: 100% (165997/165997), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
warning: unable to access 'bin/.gitattributes': Permission denied
error: unable to create file bin/brew (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
Failed during: git reset --hard origin/master
尝试添加sudo:
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
给出:
Don't run this as root!
我不知道从哪里开始。有人能帮助我吗?
答案 0 :(得分:0)
安装zsh后重启终端了吗? brew可能没有为zshell加载。另外你需要在.zshrc zsh配置文件中添加usr / local /你的$ path应该在root中〜/ .zshrc