当我尝试使用终端安装 Homebrew
时失败并出现以下错误:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/homebrew/': Could not resolve host: github.com
Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1
我认为这是因为代理设置。所以我尝试使用以下方法重置 git 代理:
git config --global --unset http.proxy
和
git config --global --unset core.gitproxy
但又失败了。
请帮忙。
最佳答案
你必须为 git 设置代理
git config --global --add http.proxy proxyHost:proxyPort
但您还必须为 Homebrew 本身设置代理:
export ALL_PROXY=proxyHost:proxyPort
关于Homebrew 安装的 SSL 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32478422/