可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
When I brew doctor
I get the following errors:
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
The file libltdl.7.dylib
is not in my /usr/lib directory, but there are several other .dylib
files.
I'm running 10.8.1 with the latest version of Xcode (4.4.1) and its Command Line Tools installed.
Any idea how to solve these errors?
回答1:
Try to re-install libtool by:
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
If that doesn't help, try removing libtool completely, and then retry the steps above:
brew uninstall libtool
If it still doesn't work after trying the steps above, check to see if you have the DYLD_FALLBACK_LIBRARY_PATH variable defined somewhere on the system (e.g. ~/.profile) and try unsetting it before trying the steps above again.
Other commands which could be useful for identifying the issue:
$ libtool --version
$ whereis libtool
$ set | grep DYLD_FALLBACK_LIBRARY_PATH
$ echo $DYLD_FALLBACK_LIBRARY_PATH
回答2:
For me it works with:
sudo ln -s /usr/local/Cellar/libtool/2.4.2/lib/libltdl.7.dylib /usr/local/lib/libltdl.7.dylib
回答3:
Try:
brew tap homebrew/dupes
See: https://github.com/josegonzalez/homebrew-php/pull/219
回答4:
if you have an error about pcre like this :
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
you need to link pcre.
brew link --overwrite pcre
回答5:
The response from kenorb is what worked for me + a little extra for safe measure:
brew update
freetype didn't have symlinks so:
brew link freetype
various other solutions I tried:
brew remove imagemagick
brew link jpeg libpng
brew install imagemagick
brew install libtiff
brew uninstall libtool
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
There's a good chance that this wasn't all necessary if I had found
brew uninstall libtool
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
first. But I thought I would post my full process in case anyone runs into issues
回答6:
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install pcre
brew install libtool
that's it.
回答7:
For me, I needed to fix XQuartz as brew doctor asked me too:
Warning: Your XQuartz (2.7.6) is outdated
Please install XQuartz 2.7.8:
https://xquartz.macosforge.org
It worked after that.
回答8:
I experienced the same error in the process of installing AFNI. Installing PyQt, as suggested here, fixed the issue resulting from OSX 10.11 compatibility.
brew install pyqt
回答9:
I had:
% neato
dyld: Library not loaded: /usr/lib/libltdl.7.dylib
Referenced from: /Users/me/Documents/dev/anaconda/bin/neato
Reason: image not found
zsh: abort neato
And the fix was
% echo $DYLD_FALLBACK_LIBRARY_PATH
/Users/me/anaconda/lib:/usr/lib
% export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/usr/local/lib
(and then add the export to a .bashrc
or similar).
回答10:
In my case I solve it with this link's file:
ln -s /usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib /usr/local/opt/jpeg/lib/libjpeg.8.dyli
回答11:
First :
brew uninstall libffi
Then :
brew install libffi