Git 在 Mac OS X 10.6 上返回“dyld:未加载库:/usr/lib/libcurl.4.dylib”错误

Git 在 Mac OS X 10.6 上返回“dyld:未加载库:/usr/lib/libcurl.4.dylib”错误

我使用的是 Mac OS 10.6。我尝试在本地运行基于 Jekyll 和 Node.js 的网站,但做了一些奇怪的事情,但没有成功,现在我遇到了基本的 git 功能问题。之前的过程包括安装 Homebrew 和升级 Ruby。

当我git pull从存储库中运行时,我得到

dyld:未加载库:/usr/lib/libcurl.4.dylib 引用自:/usr/libexec/git-core/git-remote-https 原因:不兼容的库版本:git-remote-https 需要版本 7.0.0 或更高版本,但 libcurl.4.dylib 提供版本 6.0.0

我试过来自类似问题的建议,当我进去的时候which curl,我得到了/usr/bin/curl

我认为升级 git 可能会有帮助,所以我升级了,brew install git然后得到了以下(见下文),这似乎表明我使用的是当前版本 (2.8.1)。然而,之后又git --version返回了git version 1.7.7.5 (Apple Git-26)

不知道下一步该做什么。我怎样才能让 git 再次工作?

Warning: You are using OS X 10.6.
We (and Apple) do not provide support for this old version.
You may encounter build failures or other breakages.
==> Downloading https://www.kernel.org/pub/software/scm/git/git-2.8.1.tar.xz
Already downloaded: /Library/Caches/Homebrew/git-2.8.1.tar.xz
==> make install prefix=/usr/local/Cellar/git/2.8.1 sysconfdir=/usr/local/etc CC
Last 15 lines from /Users/mikeeng/Library/Logs/Homebrew/git/01.make:
    sed -e '1{' \
        -e '    s|#!.*perl|#!/usr/bin/perl|' \
        -e '    h' \
        -e '    s=.*=use lib (split(/:/, $ENV{GITPERLLIB} || "'"$INSTLIBDIR"'"));=' \
        -e '    H' \
        -e '    x' \
        -e '}' \
        -e 's/@@GIT_VERSION@@/2.8.1/g' \
        git-add--interactive.perl >git-add--interactive+ && \
    chmod +x git-add--interactive+ && \
    mv git-add--interactive+ git-add--interactive
make[2]: *** No rule to make target `/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE/config.h', needed by `perl.mak'.  Stop.
make[1]: *** [instlibdir] Error 2
make: *** [git-add--interactive] Error 2
make: *** Waiting for unfinished jobs....

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/Homebrew/homebrew-core/issues

These open issues may also help:
git-annex 6.20160619 https://github.com/Homebrew/homebrew-core/pull/3228
hg-git 0.8.5 (new formula) https://github.com/Homebrew/homebrew-core/pull/2577
git: cannot run gitk https://github.com/Homebrew/homebrew-core/issues/115
git-webui 1.2.0 (new formula) https://github.com/Homebrew/homebrew-core/pull/1648
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 https://github.com/Homebrew/homebrew-core/issues/2385
git-gitlab 0.1.0 (new formula) https://github.com/Homebrew/homebrew-core/pull/1064
git-stree: added deprecation warning and fixed line order https://github.com/Homebrew/homebrew-core/pull/1842
Warning: You are using OS X 10.6.
We (and Apple) do not provide support for this old version.
You may encounter build failures or other breakages.

答案1

我通过卸载 git 解决了这个问题。原来我在不同的地方安装了多个 git,所以我必须这样做:

$ which git

然后使用返回的路径:

$ sudo rm -rf /absolute/path/to/git

三次,直到$ which git没有返回任何结果。然后我安装了git 1.8.4.2

然后当我跑步时$ git,我得到了:

-bash: /usr/bin/git: No such file or directory

但退出并重新启动终端可以解决这个问题,并且 git 现在似乎可以正常工作。

相关内容