➜  ~ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:77: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040677
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md etc git lib Library LICENSE.txt munki README.md sbin share .git .github .gitignore
➜  ~ brew install maven
zsh: command not found: brew

当前回答

可能会迟到,但肯定会有帮助。你必须首先安装brew。只要运行下面的命令就可以了:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

其他回答

你的电脑上已经安装了自制软件。你需要像这样修改你的PATH:

export PATH=/usr/local/bin:$PATH

或者从起始点执行brew:

/usr/local/bin/brew install maven

在我的示例中,我将以下行添加到~/.zshrc

eval "$(/opt/homebrew/bin/brew shellenv)"

运行以下设置,然后就可以使用brew了

执行unintsall脚本:-

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

设置Git Compression:- Git config——global core.compression 0

设置Git缓冲区大小:- Git config——global http。postBuffer 1048576000

运行安装脚本:— /bin/bash -c $(curl - ssl https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

我尝试了上面的方法 导出路径= / opt /组装/ bin:美元的道路 但是没有用。

所以我做了我的研究,并意识到上述代码适用于苹果芯片Mac,而不是英特尔芯片Mac。

所以我对代码进行了编辑,因为我的Mac是基于英特尔的,我这样做了,工作完美:

在查找器中,打开/编辑.zshrc文件,如果找不到,则创建一个。 粘贴以下代码:

导出路径= / usr /地方/组装/ bin:美元的道路

会有用的!!

确保先安装brew

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