➜ ~ /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
当前回答
对于2022年10月6日的最新版本…
==>下一步:
在终端上运行以下三个命令,将Homebrew添加到PATH: echo '#为Homebrew设置路径,MANPATH等。>> /Users/tusharkhatri/.zprofile Echo 'eval "$(/opt/homebrew/bin/brew shellenv)">> /Users/tusharkhatri/.zprofile $(/opt/homebrew/bin/brew shellenv) 运行brew帮助来开始 进一步的文档: https://docs.brew.sh
其他回答
也许你已经从homebrew主页上遵循了这一步。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
所以可能你的系统不能分配路径,所以遵循以下步骤。
sudo nano /etc/paths
粘贴
/opt/homebrew/bin:$PATH
保存并关闭
可能会迟到,但肯定会有帮助。你必须首先安装brew。只要运行下面的命令就可以了:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
我尝试了上面的方法 导出路径= / opt /组装/ bin:美元的道路 但是没有用。
所以我做了我的研究,并意识到上述代码适用于苹果芯片Mac,而不是英特尔芯片Mac。
所以我对代码进行了编辑,因为我的Mac是基于英特尔的,我这样做了,工作完美:
在查找器中,打开/编辑.zshrc文件,如果找不到,则创建一个。 粘贴以下代码:
导出路径= / usr /地方/组装/ bin:美元的道路
会有用的!!
16.11.2022 -更新 在brew安装期间,我得到了多行通知我将在哪里安装brew。终端对我说:
This script will install:
...
/usr/local/Homebrew
我需要的路径是最后一个。解决问题的步骤:
编辑.zshrc文件。类型: 纳米~ / . zshrc 在编辑器中添加一行: 导出路径= / usr /地方/组装/ bin:美元的道路 点击Control+X退出编辑器,Y接受更改,返回接受文件将保存的位置。
毕竟,您需要刷新您使用的终端。您可以关闭它的进程并打开或键入:
来源 ~/.zshrc
就是这样!希望有帮助。
对于此错误,zsh: command not found: brew
确保你已经安装了Brew,用这个(等待它完成安装) (编辑:在结尾添加了结尾引用)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
然后遵循命令行上显示的NEXT STEPS,它应该显示如下所示
==> Next steps:
- Add Homebrew to your PATH in /Users/$USER/.zprofile:
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/$USER/.zprofile
eval $(/opt/homebrew/bin/brew shellenv)
在相同的终端窗口上复制并粘贴第一行,然后按enter键
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/$USER/.zprofile
然后在同一终端窗口复制并粘贴最后一行,然后按enter键
eval $(/opt/homebrew/bin/brew shellenv)
最后,您应该能够使用brew帮助,如果有效,则意味着brew已正确安装并从ZSH运行。
推荐文章
- 警告用户/local/mysql/data目录不属于mysql用户
- 崇高的文本从命令行
- 在Mac OS X上使用鼠标聚焦(加上自动提升)
- 我在哪里可以找到Mac OS X Lion的“make”程序?
- 当我没有Mac的时候,在Mac/Safari上测试web应用程序
- 在Mac上安装MySQL后,使用ALTER USER语句重置MySQL root密码
- my.cnf文件在macOS上的位置
- 如何从Mac OS X上卸载MySQL ?
- Git bash错误:无法fork子进程:没有可用的终端(-1)
- 使用grep删除空行
- 查找当前可执行文件的路径,不包含/proc/self/exe
- 我如何安装imagemagick与自制?
- Git在终端提交时打开VIM,但无法返回终端
- 在Mac上安装R -警告消息:设置LC_CTYPE失败,使用“C”
- 为什么cURL返回错误“(23)Failed writing body”?