Brew医生:dyld:未加载库和错误:没有可用的zlib公式

Rya*_*yan 33 homebrew zlib dylib dyld

当我brew doctor收到以下错误时:

dyld: Library not loaded: /usr/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
Error: No available formula for zlib
Run Code Online (Sandbox Code Playgroud)

该文件libltdl.7.dylib不在我的/ usr/lib目录中,但还有其他几个.dylib文件.

我正在运行10.8.1,安装了最新版本的Xcode(4.4.1)及其命令行工具.

知道如何解决这些错误吗?

ken*_*orb 42

尝试通过以下方式重新安装libtool:

brew reinstall libtool --universal && brew unlink libtool && brew link libtool
Run Code Online (Sandbox Code Playgroud)

如果这没有帮助,请尝试完全删除libtool,然后重试上述步骤:

brew uninstall libtool
Run Code Online (Sandbox Code Playgroud)

如果在尝试上述步骤后仍然无效,请检查是否在系统某处定义了DYLD_FALLBACK_LIBRARY_PATH变量(例如〜/ .profile)并尝试取消设置,然后再重复上述步骤.


其他可能有助于识别问题的命令:

$ libtool --version
$ whereis libtool
$ set | grep DYLD_FALLBACK_LIBRARY_PATH
$ echo $DYLD_FALLBACK_LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)

  • 我不得不做`brew uninstall libtool`然后运行你的命令,一切都运行良好. (4认同)
  • 我没有`--universal`就做到了,我是Sierra 10.12.4; (3认同)

小智 10

对我来说它适用于:

sudo ln -s /usr/local/Cellar/libtool/2.4.2/lib/libltdl.7.dylib /usr/local/lib/libltdl.7.dylib
Run Code Online (Sandbox Code Playgroud)


Die*_*llo 9

如果您有关于pcre的错误,请执行以下操作:

dyld: Library not loaded: /usr/local/opt/pcre/lib/libpcre.1.dylib
  Referenced from: /usr/local/Cellar/watchman/4.7.0/libexec/bin/watchman
  Reason: image not found
Abort trap: 6
Run Code Online (Sandbox Code Playgroud)

你需要链接pcre.

brew link --overwrite pcre
Run Code Online (Sandbox Code Playgroud)