Brew doctor: dyld: Library not loaded & Error: No available formula for zlib
Solution 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
Solution 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
Solution 3
Try:
brew tap homebrew/dupes
See: https://github.com/josegonzalez/homebrew-php/pull/219
Solution 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
Solution 5
None of them work I personally reinstalled Watchman like so:
brew uninstall watchman
brew reinstall watchman
Comments
-
Ryan about 3 years
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?
-
Pavel Nikolov over 10 yearsI had to do
brew uninstall libtool
and then run your command and everything worked fine again. -
Simon Whitehead almost 10 years+1 to the above comment (and answer). I too had to uninstall my problem package then reinstall via the provided answer.
-
Mitch over 9 yearsThis worked for me - my route had been via an update to OSX Mavericks followed by a Ruby update to 2.1.1 (since anything prior doesnt seem to compile under Mavericks) and then rmagick/imagemagick falling over, requiring reinstall of ImageMagick via brew and forcing rmagick to v 2.13.2 (since 2.13.4 gave issues)
-
Kun over 7 yearsI had one issue when I tried to find out the version of libtool: error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --version ........ My Xcode version is 7.3.0
-
JESii over 6 yearsBest way I've found to handle these kinds of issues; if the DYLD library didn't get installed the first time, it generally doesn't get installed the nth time.
-
Yoshi almost 6 yearsthis is exactly what I had. Thank you Diego
-
Randy Lam over 5 yearsI made it without
--universal
and I'm Sierra 10.12.4; -
Andriy Makukha about 5 yearsOr just
brew install pcre
.