当我尝试安装自制软件时出现此错误。它开始很简单,但后来我很困惑。
cjbrigna$ 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
==> /usr/bin/sudo /usr/bin/chgrp admin /Library/Caches/Homebrew
Password:
==> 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
没问题,github停了一会儿。所以我稍后再试一次。
cjbrigna$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
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)"
这让我觉得我已经自制了。
cjbrigna$ brew help
-sh: brew: command not found
很明显我没有自制软件。
cjbrigna$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Failed to locate Homebrew!
好了,我现在无法安装或卸载自制程序。这毫无意义。我做错了什么?我感谢任何帮助。
答案 0 :(得分:1)
您可以手动完成install process:
cd /usr/local
git fetch origin master:refs/remotes/origin/master -n --depth=1
git reset --hard origin/master
然后确保/usr/local/bin
位于PATH
。如果是,那么你应该能够运行,例如brew help
检查Homebrew是否已安装。