Brew doctor: dyld: Library not loaded & Error: No available formula for zlib

36,709

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
Share:
36,709
Ryan
Author by

Ryan

SOreadytohelp Twitter Facebook LinkedIn

Updated on May 05, 2021

Comments

  • Ryan
    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
    Pavel Nikolov over 10 years
    I had to do brew uninstall libtool and then run your command and everything worked fine again.
  • Simon Whitehead
    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
    Mitch over 9 years
    This 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
    Kun over 7 years
    I had one issue when I tried to find out the version of libtool: error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeD‌​efault.xctoolchain/u‌​sr/bin/libtool: unknown option character `-' in: --version ........ My Xcode version is 7.3.0
  • JESii
    JESii over 6 years
    Best 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
    Yoshi almost 6 years
    this is exactly what I had. Thank you Diego
  • Randy Lam
    Randy Lam over 5 years
    I made it without --universal and I'm Sierra 10.12.4;
  • Andriy Makukha
    Andriy Makukha about 5 years
    Or just brew install pcre.