【问题标题】:Git not in PATH for Homebrew on MacGit 不在 Mac 上 Homebrew 的 PATH 中
【发布时间】:2019-01-18 00:49:34
【问题描述】:

几天前,我运行brew update,试图在我的 Mac 上更新自制软件(我使用 OSX 10.9.5)。当我运行这个时,我得到了这个

dyld: Library not loaded: /usr/local/opt/pcre2/lib/libpcre2-8.0.dylib
  Referenced from: /usr/local/opt/git/bin/git
  Reason: image not found
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 193: 25509 Trace/BPT trap: 5       "$HOMEBREW_PREFIX/opt/git/bin/git" --version > /dev/null
dyld: Library not loaded: /usr/local/opt/pcre2/lib/libpcre2-8.0.dylib
  Referenced from: /usr/local/opt/git/bin/git
  Reason: image not found
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 193: 25615 Trace/BPT trap: 5       "$HOMEBREW_PREFIX/opt/git/bin/git" --version > /dev/null
Warning: curl 7.63.0 is already installed, it's just not linked
You can use `brew link curl` to link this version.
dyld: Library not loaded: /usr/local/opt/pcre2/lib/libpcre2-8.0.dylib
  Referenced from: /usr/local/opt/git/bin/git
  Reason: image not found
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 193: 25750 Trace/BPT trap: 5       "$HOMEBREW_PREFIX/opt/git/bin/git" --version > /dev/null
Warning: git 2.20.1 is already installed and up-to-date
To reinstall 2.20.1, run `brew reinstall git`
Error: Git must be installed and in your PATH!

我还运行了 brew doctor ,看看是否有任何变化。这就是出现的问题。

dyld: Library not loaded: /usr/local/opt/pcre2/lib/libpcre2-8.0.dylib
  Referenced from: /usr/local/opt/git/bin/git
  Reason: image not found
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 193: 25891 Trace/BPT trap: 5       "$HOMEBREW_PREFIX/opt/git/bin/git" --version > /dev/null
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. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/Robby/anaconda2/bin/curl-config
  /Users/Robby/anaconda2/bin/freetype-config
  /Users/Robby/anaconda2/bin/icu-config
  /Users/Robby/anaconda2/bin/krb5-config
  /Users/Robby/anaconda2/bin/libpng-config
  /Users/Robby/anaconda2/bin/libpng16-config
  /Users/Robby/anaconda2/bin/ncursesw6-config
  /Users/Robby/anaconda2/bin/pcre-config
  /Users/Robby/anaconda2/bin/python-config
  /Users/Robby/anaconda2/bin/python2-config
  /Users/Robby/anaconda2/bin/python2.7-config
  /Users/Robby/anaconda2/bin/xml2-config
  /Users/Robby/anaconda2/bin/xslt-config

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: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  autoconf
  automake
  bash-completion
  brotli
  c-ares
  cask
  cmake
  cunit
  docbook
  docbook-xsl
  doxygen
  emacs
  fontconfig
  freetype
  gdbm
  geoip
  gmp
  gnutls
  htop
  itstool
  jansson
  jemalloc
  jpeg
  libev
  libevent
  libpng
  libtasn1
  libtool
  libunistring
  nettle
  nmap
  p11-kit
  pcre2
  pkg-config
  python@2
  watch

Warning: You are using macOS 10.9.
We (and Apple) do not provide support for this old version.
You may encounter build failures and other breakages.
Please create pull requests instead of asking for help on
Homebrew's GitHub, Discourse, Twitter or IRC. You are
responsible for resolving any issues you experience, as
you are running this old version.


Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
  brew install python

Run `brew missing` for more details.

这是我在运行brew missing 时出现的。

dyld: Library not loaded: /usr/local/opt/pcre2/lib/libpcre2-8.0.dylib
  Referenced from: /usr/local/opt/git/bin/git
  Reason: image not found
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 193: 26131 Trace/BPT trap: 5       "$HOMEBREW_PREFIX/opt/git/bin/git" --version > /dev/null
itstool: python
libxml2: python

有什么想法吗?我被难住了。

【问题讨论】:

  • 我会先格式化你的问题,这样人们才能真正阅读它。
  • 嗯,除了难以阅读之外,我不确定您想要实现什么以及您为此做了哪些步骤。 git 不在路径中可以通过将git 添加到路径中来解决,你有 git 吗?你是怎么安装的?你能在终端上运行git --version吗?
  • 我希望能够运行 brew update 而不会出现 git 不在我的 PATH 中的错误
  • 我修好了!!!我不得不重新安装自制软件......但现在它可以工作了!

标签: git homebrew


【解决方案1】:

我在尝试安装 android-platforms-tools 时遇到了类似的问题,我尝试重新安装 pcre2 lib,这对我有用。

brew uninstall --force pcre2

紧随其后

brew install pcre2

【讨论】:

  • 很好,很高兴我能帮上忙。
【解决方案2】:

您是否尝试过以下操作(如brew 在您的输出文本中建议的那样):

brew reinstall git

或:

brew reinstall git && brew unlink git && brew link git

或:

brew upgrade git

【讨论】:

  • 解决方案不起作用。我收到此错误:dyld:未加载库:/usr/local/opt/pcre2/lib/libpcre2-8.0.dylib
猜你喜欢
  • 1970-01-01
  • 2021-09-21
  • 1970-01-01
  • 2023-03-08
  • 2013-01-08
  • 2014-10-03
  • 2012-11-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多