Ruby -V Dyld: Library Not Loaded: /Usr/Local/Lib/Libgmp.10.Dylib

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

Update: As of December 2020 and beyond, brew switch does not work, so use the other answer by @angabriel:

brew install rbenv/tap/openssl@1.0
ln -sfn /usr/local/Cellar/openssl@1.0/1.0.2t /usr/local/opt/openssl

Original Answer:
Switch to an older openssl package

brew switch openssl 1.0.2s

Or, depending on your exact system configuration, you may need to switch to a different version. Check the output of ls -al /usr/local/Cellar/openssl for the version number to switch to.

brew switch openssl 1.0.2q
# or
brew switch openssl 1.0.2r
# or
brew switch openssl 1.0.2s
# or
brew switch openssl 1.0.2t
# etc...

dyld: Library not loaded ... Reason: Image not found

Find all the boost libraries (where exefile is the name of your executable):

$ otool -L exefile
exefile:
@executable_path/libboost_something.dylib (compatibility version 0.7.0, current version 0.7.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

and for each libboost_xxx.dylib, do:

$ install_name_tool -change @executable_path/libboost_something.dylib /opt/local/lib/libboost_something.dylib exefile

and finally verify using otool again:

$ otool -L exefile
exefile:
/opt/local/lib/libboost_something.dylib (compatibility version 0.7.0, current version 0.7.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

Manpages: otool install_name_tool

EDIT A while back I wrote a python script (copy_dylibs.py) to work out all this stuff automatically when building an app. It will package up all libraries from /usr/local or /opt/local into the app bundle and fix references to those libraries to use @rpath. This means you can easily install third-party library using Homebrew and package them just as easily.

I have now made this script public on github.

Upgrading to Ruby 2.1.3 on Mac OSx 10.9.5

So the solution, which resolved the issue is to run the following:

$ brew rm cloog; brew install cloog 

Ta-Ta. It all worked all of the sudden!

$ ruby -v
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]

Could not open library 'vips.42'; Library not loaded: '@@HOMEBREW_PREFIX@@/opt/libpng/lib/libpng16.16.dylib'

On m1, homebrew puts binaries in /opt/homebrew/lib and older versions of the ffi gem don't look there. If you update to ffi 1.15.3+ it will.

See:

https://github.com/libvips/ruby-vips/issues/284#issuecomment-1192157228

dyld: Library not loaded: /usr/local/lib/liblua.5.1.5.dylib

The problem seems to because homebrew somehow removed the old version of lua that was required for Vim to run.

So installed the specific version from homebrew like this:

  1. Search homebrew for available formulae: brew search lua; got:

    lua
    lua51
    luabind
    luajit
    luarocks
    homebrew/nginx/lua-nginx-module

  2. Installed: brew install lua51

This solved the issue. I am posting it may be able solve other brew related issues connected with installing different versions of packages.



Related Topics



Leave a reply



Submit