➜ ~ /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
当前回答
因为你正在使用zsh,你需要添加路径到你的。zshrc文件:
vim ~ / . zshrc
Add:
export BREW_HOME="/home/linuxbrew/.linuxbrew/bin"
export PATH="$PATH:$BREW_HOME"
其他回答
也许你已经从homebrew主页上遵循了这一步。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
所以可能你的系统不能分配路径,所以遵循以下步骤。
sudo nano /etc/paths
粘贴
/opt/homebrew/bin:$PATH
保存并关闭
编辑.zshrc文件:
nano .zshrc
并在文件的开头添加以下内容:
export PATH=/opt/homebrew/bin:$PATH
保存并运行:
source ~/.zshrc
在我的示例中,我将以下行添加到~/.zshrc
eval "$(/opt/homebrew/bin/brew shellenv)"
它帮助我。只需运行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)"
更新2023
export PATH="/opt/homebrew/bin:$PATH"
推荐文章
- 如何从终端/命令行调用VS代码编辑器
- 访问限制:'Application'类型不是API(必需库rt.jar的限制)
- 为什么在Mac OS X v10.9 (Mavericks)的终端中apt-get功能不起作用?
- “你有邮件”的消息在终端,os X
- Mac OS X中的环境变量
- Homebrew:以新的formula@version格式列出可用版本
- 如何从macOS完全卸载蟒蛇
- 如何配置Mac OS X术语,使git有颜色?
- 如何使制表符4个空间而不是8个空间在纳米?
- 我如何确定文件编码在OS X?
- 使iTerm以与其他操作系统相同的方式翻译“元键”
- 错误:无法在ARM处理器上的Homebrew中安装英特尔默认前缀(/usr/local)
- 如何强制从另一个SSH会话分离屏幕?
- 酿造更新失败:未跟踪的工作树文件将被合并覆盖
- 如何从终端机发送电子邮件?