2016-04-08 441 views
4

安装brew报告,发现它找不到git,并死于错误。啤酒似乎已经被安装Brew找不到git,尽管git在路径中(Mac/OSX)

> brew

(打印常用的帮助)

...但brew doctor不开心(成功):

这是我所得到的,当我运行(当我按照Homebrew主页的说明首次安装啤酒时)。

> 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 
+0

你检查过,如果你的git版本是> =一个brew需要的(如果指定的话) – pedrorijo91

+0

@ pedrorijo91它没有。 – bfontaine

+1

请运行'cd $(brew --prefix)&& git fetch && git reset --hard origin/master'然后再次运行'brew doctor'。 – bfontaine

回答

0

啤酒可能正常工作了你,你可以brew install没有任何问题。

看起来像brew doctor宁愿使用brew来安装git,而不是使用OSX系统默认安装git

为了brew doctor快乐,运行:

> brew install git

将安装git/usr/local/bin/git,并可能做出错误消失。

0

您是否安装了命令行工具?

xcode-select --install