/opt/boxen/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ffi-1.9.18/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open library 'glib-2.0': dlopen(glib-2.0, 5): image not found. (LoadError)
Could not open library 'libglib-2.0.dylib': dlopen(libglib-2.0.dylib, 5): image not found
from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ffi-1.9.18/lib/ffi/library.rb:100:in `map'
from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ffi-1.9.18/lib/ffi/library.rb:100:in `ffi_lib'
from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-vips-2.0.6/lib/vips.rb:28:in `<module:GLib>'
from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-vips-2.0.6/lib/vips.rb:13:in `<top (required)>'
from ruby_io_speed.rb:1:in `require'
from ruby_io_speed.rb:1:in `<main>'
rake aborted!
I’m not sure why this isn’t working with Macports but after I manually (yuck) copied the required library to
/usr/local/lib, it worked. So, is there something special about/usr/local/libbut not/opt/local/lib?I just tried on my mac and it all seems to work for me. Here’s what I see. First, brew:
Then Ruby (I’m using the old Apple one):
So I’d check:
/usr/local/lib/usr/localLooking at @jcupitt 's comments, I went to ffi/ffi#968 and to the forked library. From there, I went to
gems/ffi-1.15.5/lib/ffiwhich is the culprit for me.mv library.rb library.rb.oldlibrary.rband copy contents from https://github.com/eregon/ffi/blob/refactor-library-lookup/lib/ffi/library.rbdynamic_library.rband copy contents from https://github.com/eregon/ffi/blob/refactor-library-lookup/lib/ffi/dynamic_library.rbYields a satisfying:
Yes, this is a hack. But, it looks like there is conversation around a long-term fix, and this gets me through the night.
Facing this error on M1, any quick fix?