【发布时间】:2016-07-14 05:57:27
【问题描述】:
我在 OS X El Capitan 上安装了 Homebrew。在安装的最后步骤中,我应该使用
安装 gitbrew install git
这很好。现在,如果我运行“brew doctor”,就会发生这种情况:
$ 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
如果我再次运行“brew install git”,我会得到:
$ brew install git
Warning: git-2.7.4 already installed
所以不用说我的 git 版本是 2.7.4。 'brew update' 抛出:
$ brew update
Warning: git-2.7.4 already installed
Error: Git must be installed and in your PATH!
问题:如何修复我的 PATH,以便可以在我的 PATH 中找到 git,并且“brew doctor”会导致“您的系统已准备好进行 brew”?
附加信息:
-
which -a git 结果:
$ which -a git /usr/local/bin/git /usr/local/bin/git /usr/bin/git -
我尝试了很多可能的修复,同时我执行了:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile我的 ~/.bash_profile 现在看起来像这样:
# Setting PATH for Python 2.7 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH=/usr/local/bin:$PATH -
当我尝试安装木桶时:
$ brew tap caskroom/cask ==> Installing git Warning: git-2.7.4 already installed Error: Git is unavailable -
酿造配置:
$ brew config HOMEBREW_VERSION: 0.9.5 ORIGIN: (none) HEAD: (none) Last commit: never HOMEBREW_PREFIX: /usr/local HOMEBREW_REPOSITORY: /usr/local HOMEBREW_CELLAR: /usr/local/Cellar HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com CPU: quad-core 64-bit haswell OS X: 10.11.4-x86_64 Xcode: 7.3 CLT: 7.3.0.0.1.1457485338 Clang: 7.3 build 703 X11: N/A System Ruby: 2.0.0-p648 Perl: /usr/bin/perl Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/bin/python2.7 Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby Java: 1.8.0_40
编辑:向附加信息添加了木桶。
EDIT2:添加了 brew 配置并添加了 brew doctor 前缀
【问题讨论】:
-
请同时发布
brew doctor和brew config的完整输出。 -
@bfontaine 我添加了
brew config并完成了brew doctor(关于自制警告的一般说明,我一开始认为这并不重要)。 -
谢谢;
source ~/.bash_profile能解决问题吗? -
很遗憾没有。我在 2 天前与 TheGeorgeous 的方法一起尝试过,但没有奏效。几秒钟前我也试过了,
brew doctor仍然提供相同的输出 -
brew info git的输出是什么?