1、homebrew安装
使用官方下载源/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"下载时总会报错error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL。
错误原因:gfw导致的网络原因。
解决办法:参考macOS High Sierra10.13.3安装homebrew报错和Homebrew 镜像使用帮助。
首先先下载脚本并命名为brew_install。
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
然后用vim或其他编辑器打开brew_install并修改一下两项为:
BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git “.freeze
CORE_TAP_REPO = “https://mirrors.ustc.edu.cn/homebrew-core.git“.freeze
执行脚本,终端中输入
/usr/bin/ruby brew_install
此时会报错,终端中继续输入
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew update
更换好下载源之后homebrew即安装完成。
(未完待续)