➜ ~ /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"
其他回答
在Apple M1的fish shell中,我必须将/opt/homebrew/bin添加到fish_user_paths全局环境中。我必须手动这样做,因为set -U fish_user_paths /opt/homebrew/bin $fish_user_paths got
设置:通用变量fish_user_paths被同名的全局变量遮蔽。
也许你已经从homebrew主页上遵循了这一步。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
所以可能你的系统不能分配路径,所以遵循以下步骤。
sudo nano /etc/paths
粘贴
/opt/homebrew/bin:$PATH
保存并关闭
请访问Homebrew官方网站。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
下一个步骤:
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
尝试:brew install hello
因为你正在使用zsh,你需要添加路径到你的。zshrc文件:
vim ~ / . zshrc
Add:
export BREW_HOME="/home/linuxbrew/.linuxbrew/bin"
export PATH="$PATH:$BREW_HOME"
更新2023
export PATH="/opt/homebrew/bin:$PATH"
推荐文章
- 如何在Mac上的命令行安装JQ ?
- 在Mac OS X上安装/升级gradle
- 如何在终端中提高光标速度?
- 修改一个目录下所有文件和文件夹的权限为644/755
- Objective-C中的自动引用计数不能防止或减少什么样的泄漏?
- 仅在文件不存在时才将行追加到文件中
- 如何在Mac OS安装时停止MySQL ?
- PIP成功安装包,但在命令行中找不到可执行文件
- 无法在Mac OS X 10.9上安装Lxml
- 在OS X上使用sed进行就地编辑
- MacVim和普通Vim有什么区别?
- 查看保存的NSUserDefaults的简单方法?
- 如何清除tmux中的滚动缓冲区?
- homebrew、macports或其他软件包安装工具的区别/用途是什么?
- (Mac) -bash: __git_ps1:命令未找到