【发布时间】:2016-04-08 04:03:34
【问题描述】:
安装 brew 报告它找不到 git,并因错误而死。 Brew 似乎已安装(成功?)
> brew
(打印通常的帮助)
...但是brew doctor 不高兴:
这是我在运行 brew doctor 时得到的(当我按照 Homebrew 主页上的说明第一次安装 brew 时。)
> brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Git could not be found in your PATH.
Homebrew uses Git for several internal functions, and some formulae use Git
checkouts instead of stable tarballs. You may want to install Git:
brew install git
Error: Git is unavailable
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q
我的路径:
> echo $PATH
/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Git 在这里:
> which git
/usr/bin/git
【问题讨论】:
-
你检查过你的 git 版本是否 >= 一个 brew 需要的版本(如果有的话)
-
@pedrorijo91 它没有。
-
请运行
cd $(brew --prefix) && git fetch && git reset --hard origin/master,然后再次运行brew doctor。 -
@bfontaine 谢谢,但没用:
-
@OlaVikholt 命令不起作用?或者他们工作但没有解决您的问题?
标签: git macos path command-line-interface homebrew