安装:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
可参考官网:
使用
brew list nginx # 来显示路径 brew info ngnix # 查看nginx安装是安装文件
报错:
-bash: brew: command not found
解决办法:
终端输入
sudo vim .bash_profile
输入i进入输入模式, 添加
export PATH="/usr/local/bin:$PATH"
按esc键退出输入模式, 输入:wq退出并保存, 最后输入使配置生效
source .bash_profile
报错:
brew `require': cannot load such file
解决办法
重新安装Homebrew
报错
LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
# 1、下载install文件 $ curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install # 2、修改镜像地址为 中国科学技术大学镜像 $ cat brew_install # BREW_REPO = "https://github.com/Homebrew/brew".freeze # CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git".freeze CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core.git".freeze # 3、执行安装脚本 $ /usr/bin/ruby brew_install
参考
macOS High Sierra10.13.3安装homebrew报错LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54解决方法