酿酒医生警告:如何将git添加到PATH? [英] brew doctor Warning: How to add git to PATH?

查看:752
本文介绍了酿酒医生警告:如何将git添加到PATH?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OS X El Capitan上安装了Homebrew.在安装的最后步骤中,我应该使用

I installed Homebrew on OS X El Capitan. In the last steps of the installation I was supposed to install git with

brew install git

很好.现在,如果我运行酿酒医生",就会发生这种情况:

which was fine. Now if I run 'brew doctor' this happens:

$ 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",则会得到:

If I run 'brew install git' again, I get:

$ brew install git 
Warning: git-2.7.4 already installed

所以不用说我的git版本是2.7.4. 酿造更新"引发:

So needless to say my git version is 2.7.4. 'brew update' throws:

$ brew update
Warning: git-2.7.4 already installed
Error: Git must be installed and in your PATH!

问题:我该如何修复PATH,以便在PATH中找到git,并且酿造医生"会导致您的系统已准备好酿造"?

Question: How do I fix my PATH so git can be found in my PATH and 'brew doctor' results in 'Your system is ready to brew'?

其他信息:

  • -a git产生的结果:

  • which -a git results in:

$ which -a git
/usr/local/bin/git
/usr/local/bin/git
/usr/bin/git

  • 我尝试了很多潜在的修复程序,同时执行了:

  • I tried a lot of potential fixes, meanwhile I executed:

    echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
    

    我的〜/.bash_profile现在看起来像这样:

    My ~/.bash_profile now looks like this:

    # 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
    

  • 当我尝试安装酒桶时:

  • When I try to install cask:

    $ brew tap caskroom/cask
    ==> Installing git
    Warning: git-2.7.4 already installed
    Error: Git is unavailable
    

  • 酿造配置:

  • brew config:

    $ 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
    

  • 将酒桶添加到其他信息中.

    Added cask to additional information.

    添加了brew配置并添加了brew doctor前缀

    Added brew config and added brew doctor prefix

    推荐答案

    这解决了我的问题:

    cd /usr/local/Library/Homebrew
    git pull origin master
    

    之后我又跑了

    brew update && brew upgrade
    

    这篇关于酿酒医生警告:如何将git添加到PATH?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆