2016-04-08 329 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