Error git must be installed and in your path

Please fill out the issue checklist below, and provide all of the requested information. Please always follow these steps: Confirmed this is a problem with running a brew command and not brew insta...

No, I confirm that HOMEBREW_DEVELOPER is never set. Here are the outputs:

+ brew irb
==> Interactive Homebrew Shell
Example commands available with: brew irb --examples
Switch to inspect mode.
[which("git"); Utils.git_available?, Utils.git_path, Utils.git_version]
SyntaxError: (irb):1: syntax error, unexpected ';', expecting ']'
[which("git"); Utils.git_available?, Utils....
              ^
(irb):1: syntax error, unexpected ',', expecting end-of-input
...h("git"); Utils.git_available?, Utils.git_path, Utils.git_ve...
...                               ^
	from /scratch/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:100:in `<main>'

+ HOMEBREW_NO_ENV_FILTERING=1
+ brew irb
==> Interactive Homebrew Shell
Example commands available with: brew irb --examples
Switch to inspect mode.
[which("git"); Utils.git_available?, Utils.git_path, Utils.git_version]
SyntaxError: (irb):1: syntax error, unexpected ';', expecting ']'
[which("git"); Utils.git_available?, Utils....
              ^
(irb):1: syntax error, unexpected ',', expecting end-of-input
...h("git"); Utils.git_available?, Utils.git_path, Utils.git_ve...
...                               ^
	from /scratch/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:100:in `<main>'

++ brew --prefix
+ HOMEBREW_GIT=/scratch/.linuxbrew/opt/git/bin/git
+ brew irb
==> Interactive Homebrew Shell
Example commands available with: brew irb --examples
Switch to inspect mode.
[which("git"); Utils.git_available?, Utils.git_path, Utils.git_version]
SyntaxError: (irb):1: syntax error, unexpected ';', expecting ']'
[which("git"); Utils.git_available?, Utils....
              ^
(irb):1: syntax error, unexpected ',', expecting end-of-input
...h("git"); Utils.git_available?, Utils.git_path, Utils.git_ve...
...                               ^
	from /scratch/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:100:in `<main>'

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

If I run ‘brew install git’ again, I get:

$ brew install git 
Warning: git-2.7.4 already installed

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!

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’?


Additional Information:

  • 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
    

    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
    

EDIT: Added cask to additional information.

EDIT2: Added brew config and added brew doctor prefix

Содержание

  1. cannot install on Mac OSX 10.8.5 ==> Downloading and installing Homebrew. You must: brew install git You must: brew install git Error: Git is unavailable #2385
  2. Comments
  3. Bug reports:
  4. brew update fails with «Git must be installed and in your PATH!» #3029
  5. Comments
  6. brandonsimpson / reinstall_git_brew.md
  7. Homebrew not finding newer git from $PATH #6274
  8. Comments
  9. What you were trying to do (and why)
  10. What happened (include command output)
  11. What you expected to happen
  12. Step-by-step reproduction instructions (by running brew commands)
  13. brew doctor
  14. brew config

cannot install on Mac OSX 10.8.5 ==> Downloading and installing Homebrew. You must: brew install git You must: brew install git Error: Git is unavailable #2385

  • Ran brew update and retried your prior step?
  • Ran brew doctor , fixed as many issues as possible and retried your prior step?
  • If you’re seeing permission errors tried running sudo chown -R $(whoami) $(brew —prefix) ?

You can erase any parts of this template not applicable to your Issue.

Bug reports:

Please replace this line with a brief summary of your issue AND if reporting a build issue include the link from:

Katoo$ ruby -e «$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)»
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/.
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew.

You must: brew install git
You must: brew install git
Error: Git is unavailable
Failed during: /usr/local/bin/brew tap homebrew/core
macbookato:

Katoo$ brew install wget
You must: brew install git
You must: brew install git
You must: brew install git
You must: brew install git
Error: Git is unavailable
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q
macbookato:

Katoo$ brew update
You must: brew install git
You must: brew install git
Error: Git must be installed and in your PATH!
macbookato:

Katoo$ brew update
You must: brew install git
You must: brew install git
Error: Git must be installed and in your PATH!
macbookato:

Katoo$ brew doctor
You must: brew install git
You must: brew install git
You must: brew install git
You must: brew install git
Error: Git is unavailable
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q
macbookato:

Katoo$ brew edit $FORMULA
You must: brew install git
You must: brew install git
Error: Changes will be lost!
The first time you brew update’, all local changes will be lost, you should thus brew update’ before you brew edit’! macbookato:

Источник

brew update fails with «Git must be installed and in your PATH!» #3029

brew update fails with this error:

Detailed infos follows. Thanks for any help!

$ brew update Warning: git-2.9.0 already installed Error: Git must be installed and in your PATH! $ which -a git /usr/local/bin/git /usr/local/bin/git /usr/bin/git $ echo $PATH /Users/stefanscheidt/.sdkman/candidates/maven/current/bin:/Users/stefanscheidt/.sdkman/candidates/ant/current/bin:/Users/stefanscheidt/.rbenv/shims:/Users/stefanscheidt/.nvm/versions/node/v4.3.2/bin. /Users/stefanscheidt/.local/bin:/Users/stefanscheidt/local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin»>

The text was updated successfully, but these errors were encountered:

As of about 30 minutes ago I’m having the exact same problem.

You may need to:

To escape the error. Should only need doing once if brew update remains stuck.

@DomT4 Don’t think that’s necessary any more but folks: if it is, please let me know.

It seems to be, based on checking locally & our CI output. If you ended up there, can’t seem to brew update successfully.

For me, brew update seems to work fine again!

Thanks for the super fast fix!

I had to switch to master to get it work again, and still getting the weird message:

@hannesN What’s your brew doctor and brew config output?

I had the same issues as above, my brew doctor output looked like

I ran xcode-select —install and made sure i had /usr/local/sbin in my path and now brew’s working great again.

Btw, it was working fine yesterday, I think installing macOS High Sierra last night is what tripped it up.

What happens if you manually run git after the update to High Sierra? Does it throw out anything interesting?

The above solution ( xcode-select —install ) fixed my issue, so I deleted my previous comment.
I do remember that running git would print an error message right after the upgrade to High Sierra, but unfortunately I cannot remember the exact error. But I managed to fix it then (again I can’t remember how exactly 🙁

I had this problem this morning, and after reading the comments here I figured it could be related to me having moved Xcode.app to the trash a few days ago. I tried some of the commands suggested here, namely xcode-select —install but nothing worked. Here’s a detailed walkthrough of what I did, although I think the last step alone might fix this issue for you.

Removed all Xcode.app-related leftovers, according to the commands listed in the top answer to this question (and the top comment to that answer, as well).

I ran sudo rm -rf /Library/Developer/CommandLineTools which deleted my standalone version of the command line tools. You might not have this, so this command might return «No such file or directory». This is fine.

I (re)installed the standalone command line tools with xcode-select —install . This still didn’t fix Homebrew finding git for me, so I then read the man page for xcode-select and I did.

sudo xcode-select -r . This should make your brew doctor output «ready to brew».

You might also need to update the newly installed command line tools with the App Store; a new update should show up in the «Updates» section.

Источник

brandonsimpson / reinstall_git_brew.md

Re-installing Git on Mac OSX with Brew

This is helpful if you’ve previously installed git from source on OSX, and other compilers can’t find the correct path. You need to remove the current version of git, then re-install with brew.

Uninstall git if installed manually

Check which git you’re running:

output should be similar to this: /usr/bin/git

Remove that git install

Re-install git with brew

Check which git you’re now running:

Should now say: /usr/local/bin/git

I follow the instructions and then I am being requested to enter a password.

I do enter the password, but I get an error message:

Thanks for your help.

I have gone through the steps you listed in this instruction set, however once I run the «sudo rm -rf /usr/bin/git/» I get the error

rm: /usr/bin/git: Operation not permitted

I am currently running MacOS Mojave v.10.14.6.

and I have Xcode installed (if that means anything).

Please advise.
-Pete8451

I have gone through the steps you listed in this instruction set, however once I run the «sudo rm -rf /usr/bin/git/» I get the error

rm: /usr/bin/git: Operation not permitted

I am currently running MacOS Mojave v.10.14.6.

and I have Xcode installed (if that means anything).

Did you found out a solution for your problem?? I got the same error «Operation not permitted» and I’ve been struggling for days with this problem

I have gone through the steps you listed in this instruction set, however once I run the «sudo rm -rf /usr/bin/git/» I get the error
rm: /usr/bin/git: Operation not permitted
I am currently running MacOS Mojave v.10.14.6.
and I have Xcode installed (if that means anything).
Please advise.
-Pete8451

Did you found out a solution for your problem?? I got the same error «Operation not permitted» and I’ve been struggling for days with this problem

Hey people! I was able to get this issue resolved. However i had to install manually (not using brew initially).

I followed the steps from the Git website to reinstall Git.
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
It automatically updated the git version i had on my Mac. Having XCode on my device did not effect the install. I know this may seem broad, but it worked for me!! hope this helps!

Hi guys, I am having a similar issue. I checked my git version and it was 2.23.0, I did brew install git which should have updated to 2.28.0 I believe however when I restarted my mac and checked git version I still see 2.23.0. I checked which git and it shows «/usr/local/bin/git». How do I know if I am using the right git on my system?

rm: /usr/bin/git: Operation not permitted is because Mac’s «System Integrity Protection».

Hey people! I was able to get this issue resolved. However i had to install manually (not using brew initially).

I followed the steps from the Git website to reinstall Git.
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
It automatically updated the git version i had on my Mac. Having XCode on my device did not effect the install. I know this may seem broad, but it worked for me!! hope this helps!

this worked for me — now running: git version 2.27.0 Catalina 10.15.7

Hi guys, I am having a similar issue. I checked my git version and it was 2.23.0, I did brew install git which should have updated to 2.28.0 I believe however when I restarted my mac and checked git version I still see 2.23.0. I checked which git and it shows «/usr/local/bin/git». How do I know if I am using the right git on my system?

IMPORTANT EDIT — Any solution I wrote in this comment should be ignored unless you’ve already done the following: restarted your terminal after running brew install git (important!), ensured which git is returning /usr/local/bin/git and that this is what brew installed, confirmed /usr/local/bin/git —version is displaying the new version installed via brew, and if git —version is still returning the old Xcode version even after restarting your terminal then you can either use simple workarounds to add the path to the proper git install as others and myself mentioned (shown below this edit) or you can use people’s solutions above to remove Xcode’ git . However it’s unlikely any of this is necessary with newer versions of macOS if you’ve restarted the terminal after installing git with homebrew. For details see @martbe’s comment and my comment below it that explains where confusion can happen after installing git with homebrew alongside Xcode’s git. For newer versions of macOS, the problem that myself and possibly others experienced is due to simply not restarting the terminal after running brew install git .

See above edit before reading further.

If you do which -a git you’ll notice there are multiple versions of git installed assuming you have one installed from XCode (or straight from git) and another that you’ve just installed from homebrew.

The one in /usr/local/bin/git is the one from homebrew which you can confirm with ls -al /usr/local/bin/git and you’ll see it’s symlinked to the git binary installed in homebrew’s Cellar directory. You can alternatively confirm by passing —version to each absolute command path to see which is which.

When you run a non-absolute command like git it will search directories in the $PATH environment variable and use the first command it finds so you should run echo $PATH and ensure that /usr/local/bin comes before /usr/bin , and if it does then running git should run the correct command for you. Btw, macOS sets up the $PATH variable this way by default but if you’ve changed your $PATH just ensure that /usr/local/bin comes first.

If the above is true and $PATH is correct but git —version is still running the /usr/bin/git command then the quickest and simplest fixes are to either:

    Set an alias like somebody else said by adding alias git=»/usr/local/bin/git» to

/.bash_aliases .

  • Add the correct git command to $PATH by adding export PATH=$PATH:/usr/local/bin/git
  • If that case is happening where $PATH is correctly loading from /usr/local/bin first but git is still running the /usr/bin/git command, I think this may have to do with Xcode overriding things but somebody else who’s more knowledgeable of Xcode can confirm this since I’m not sure. I’ve just seen odd things like this before, and it would explain some of these weird cases (and I know Xcode has things like xcrun to find tools). I’m just not sure. EditThis could also be related to @martbe’s point about reloading terminal, even for older versions, not sure. I’m leaving this be now lol. I’ve done enough damage!

    Источник

    Homebrew not finding newer git from $PATH #6274

    • are reporting a bug others will be able to reproduce and not asking a question. If you’re not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
    • ran a brew command and reproduced the problem with multiple formulae? If it’s a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it’s a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it’s a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
    • ran brew update and can still reproduce the problem?
    • ran brew doctor , fixed all issues and can still reproduce the problem?
    • ran brew config and brew doctor and included their output with your issue?

    What you were trying to do (and why)

    brew update a new install of LinuxBrew to /extra/josephlong/.linuxbrew .

    What happened (include command output)

    Despite the existence of a newer git on $PATH :

    Homebrew appears to use system git , which is much older:

    which results in the following errors:

    Tag creation options
    -a annotated tag, needs a message
    -m message for the tag
    -F message in a file
    -s annotated and GPG-signed tag
    -u use another key to sign the tag
    -f, —force replace the tag if exists

    Tag listing options
    —contains print only tags that contain the commit

    error: unknown option `list’
    usage: git tag [-a|-s|-u ] [-f] [-m |-F ] []
    or: git tag -d .
    or: git tag -l [-n[]] []
    or: git tag -v .

    Tag creation options
    -a annotated tag, needs a message
    -m message for the tag
    -F message in a file
    -s annotated and GPG-signed tag
    -u use another key to sign the tag
    -f, —force replace the tag if exists

    Tag listing options
    —contains print only tags that contain the commit

    Read the analytics documentation (and how to opt-out) here:
    https://docs.brew.sh/Analytics

    error: unknown option `local’
    usage: git config [options]

    Config file location
    —global use global config file
    —system use system config file
    -f, —file use given config file

    Action
    —get get value: name [value-regex]
    —get-all get all values: key [value-regex]
    —get-regexp get values for regexp: name-regex [value-regex]
    —replace-all replace all matching variables: name value [value_regex]
    —add adds a new variable: name value
    —unset removes a variable: name [value-regex]
    —unset-all removes all matches: name [value-regex]
    —rename-section rename section: old-name new-name
    —remove-section remove a section: name
    -l, —list list all
    -e, —edit opens an editor
    —get-color find the color configured: [default]
    —get-colorbool
    find the color setting: [stdout-is-tty]

    Type
    —bool value is «true» or «false»
    —int value is decimal number
    —bool-or-int value is —bool or —int
    —path value is a path (file or directory name)

    Other
    -z, —null terminate values with NUL byte

    Error: Failure while executing; git config —local —replace-all homebrew.analyticsmessage true exited with 129.

    What you expected to happen

    I expected brew update to complete without errors.

    Step-by-step reproduction instructions (by running brew commands)

    brew doctor

    brew config

    The text was updated successfully, but these errors were encountered:

    Источник

    Just a quick note to everyone jumping on the new macOS Mojave release.

    I’m a big fan of Homebrew, and after upgrading macOS I figured it would be a good idea to upgrade Homebrew as well.

     ~ $ brew update
    ==> Downloading https://homebrew.bintray.com/bottles/git-2.18.0.mojave.bottle.ta
    ...
    ==> Summary
    🍺  /usr/local/Cellar/git/2.18.0: 1,488 files, 296.7MB
    Error: Git must be installed and in your PATH!
    

    Well, that’s strange, Homebrew was working just fine before the upgrade.

    Turns out that the Mojave upgrade didn’t also upgrade my Xcode Command Line tools, which causes this error when upgrading Homebrew.

    Luckily there is a really quick fix for this; just install the Xcode command line tools!

     ~ $ xcode-select --install
    xcode-select: note: install requested for command line developer tools
    

    Let that run, and Homebrew upgrades itself without problems.

     ~ $ brew update
    Updated 2 taps (homebrew/core, homebrew/cask).
    

    I’m expecting some other upgrades to Homebrew in soonish, since it still considers Mojave (macOS 10.14) to be a pre-release version so official support isn’t quite there yet.

    • macOS: Lulu —
      12 Sep, 2018

    Post last updated on July 17, 2020: markdownlint fixes

    I got an error when trying to upload brew.
    Help me. I got in the way of preparing to install cocopads.

    $brew update
    Warning: git 2.15.1_1 is already installed
    Error: Git must be installed and in your PATH!</Code></pre>
    <pre><code>$brew config
    HOMEBREW_VERSION:&gt;= 1.4.0 (shallow or no git repository)
    ORIGIN: (none)
    HEAD: (none)
    Last commit: never
    Core tap ORIGIN: (none)
    Core tap HEAD: (none)
    Core tap last commit: never
    HOMEBREW_PREFIX:/usr/local
    HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
    CPU: quad-core 64-bit broadwell
    Homebrew Ruby: 2.3.3 =&gt;/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
    Clang: N/A
    Git: N/A
    Curl: 7.54.0 =&gt;/usr/bin/curl
    Perl:/usr/bin/perl
    Python:/usr/bin/python
    Ruby:/usr/bin/ruby ​​=&gt;/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    Java: N/A
    macOS: 10.12.6-x86_64
    Xcode: N/A
    CLT: N/A
    X11: 2.7.11 =&gt;/opt/X11
    $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 or file an issue;just ignore this.
    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
    Warning: No developer tools installed.
    Install the Command Line Tools:
      xcode-select --install

    Please let me know if you need that information. Thank you.

    $which-a git
    / usr/local/bin/git
    $echo $PATH
    /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/TomohisaSutani/.rvm/bin

    Я установил Homebrew на OS X El Capitan. На последних этапах установки я должен был установить git с

    brew 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, чтобы git можно было найти в моем PATH, а команда «brew doctor» показала «Ваша система готова к работе»?


    Дополнительная информация:

    • который -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: добавлена конфигурация заваривания и добавлен префикс доктора пивоварения.

    7 ответов

    Лучший ответ

    Это устранило мою проблему:

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

    После этого я снова побежал

    brew update && brew upgrade
    


    31

    Lucian Irimie
    16 Июл 2016 в 06:57

    Просто запустите:

    export PATH=/usr/local/bin:$PATH
    

    Ваша переменная PATH должна выглядеть примерно так

    PATH="/usr/bin:/usr/local/bin"
    


    1

    TheGeorgeous
    26 Мар 2016 в 18:04

    Для меня это было вызвано отсутствием инструментов xcode, исправленных с помощью xcode-select --install.

    Несколько других предлагаемых исправлений, включая git fetch в каталоге brew и / или изменение git core.autocrlf, не помогли.

    Более подробно я удалил git из brew brew uninstall --force git, но собственный git Apple тогда не работал (/usr/bin/git --version сообщил missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun).

    Запуск brew doctor предложил запустить xcode-select --install, я запустил его, и он исправил git от Apple, а также исправил brew. (Затем можно переустановить git с помощью brew brew install git.)


    12

    MikeBeaton
    13 Дек 2017 в 23:09

    Если вы похожи на меня: используете macOS El Capitan и у вас нет /usr/local/Library/ENV/scm/git, вот что вы можете сделать.

    cd /usr/local/
    # The folder where you've installed Homebrew
    git config --list --local
    

    Ищите: core.autoxrlf=false

    Если этого не происходит: git config --local core.autocrlf false

    Затем запустите:

    git fetch origin
    git reset --hard origin/master
    brew update
    


    0

    Sandeep M
    21 Июл 2016 в 22:33

    Я столкнулся с тем же симптомом при попытке запустить brew update.

    В моем случае проблема была вызвана тем, что для переменной bash установлено значение GIT (для каталога). Итак, решение заключалось в том, чтобы отключить его для команды brew

    $ GIT= brew update
    


    0

    jalanb
    7 Апр 2016 в 14:38

    Я нашел решение своей проблемы. Это было вызвано неправильным форматом файла /usr/local/Library/ENV/scm/git:

    $ /usr/local/Library/ENV/scm/git --version
    -bash: /usr/local/Library/ENV/scm/git: /bin/sh^M: bad interpreter: No such file or directory
    

    Итак, я отредактировал формат файла:

    $ vi /usr/local/Library/ENV/scm/git
    

    Нажмите «ESC», напишите :set fileformat=unix, нажмите «Enter», напишите :wq!.

    Это исправило это для меня.


    1

    ncw
    29 Мар 2016 в 14:57

    Вероятная проблема с libintl.8.dylib, как и во многих других подобных вопросах:

    locate libintl.8.dylib
    

    Если существует / gettext / /libintl.*.dylib

    brew link -f gettext
    

    Перейти (в зависимости от версии)

    cd /usr/local/Homebrew 
    cd /usr/local/Library/Homebrew 
    

    И выполните (убедитесь, что вы находитесь в каталоге … / Homebrew)

    git pull origin master
    rm -fr ".git/rebase-apply"
    brew update && brew upgrade
    

    Это последнее занятие заняло некоторое время, но после этого все должно работать нормально.


    0

    rapttor
    15 Авг 2019 в 09:47

    Понравилась статья? Поделить с друзьями:
  • Error git is not installed
  • Error girl anime
  • Error game specific settings could not be initialised none of the supported games were detected
  • Error game shop invalidserver
  • Error game installation not found