➜  ~ /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有这个-NEXT STEPS控制台日志,需要包含它到bash的路径。

执行如下步骤:

`echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/YOUR_USER/.zprofile`

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

其他回答

在安装时,brew有这个-NEXT STEPS控制台日志,需要包含它到bash的路径。

执行如下步骤:

`echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/YOUR_USER/.zprofile`

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

我在Ubuntu和Arch Linux上也遇到了同样的问题。我通过在.zshrc文件中添加brew的bin文件夹路径来解决这个问题。

brew安装bin目录的路径是/home/linuxbrew/.linuxbrew/bin

将下面的行添加到~/。zshrc中 导出路径= / home / linuxbrew / .linuxbrew / bin:美元的道路

在此之后,打开一个新终端,brew命令将可用。

下面是我做的步骤。

1.安装自酿酒

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

2.运行brew help,看看它是否工作…如果显示错误“zsh: command not found: brew”,请继续执行。

修改路径为:

echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/"YOUR USER NAME"/.zprofile

记得把“用户名”改成你的, 然后输入:

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

成功运行这些命令后,键入“brew help”查看是否一切正常。

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

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

它帮助我。只需运行follow命令:

echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/gureenkov56/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/gureenkov56/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"