-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS Could not open library 'libglib-2.0.dylib': dlopen(libglib-2.0.dylib, 5): image not found #130
Comments
Hello, how did you install libvips? If you use |
Yes it is brew |
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:
|
I tried with the brew Ruby and that worked too.
|
|
Hello again, it doesn't need to build it, it's all written in Ruby, it uses FFI to call into the dylib. Were you able to confirm that you have the dylibs in If they are fine, I think the issue must be with your Ruby install. For some reason it cannot see libraries in |
What does this mean? |
Do you have the libraries in
|
Nope, homebrew installed it in other place
|
I'm not sure why this isn't working with Macports but after I manually (yuck) copied the required library to |
Facing this error on M1, any quick fix? |
Same for me |
It's an ffi issue -- ruby-vips is asking for Here's the ruby-vips code: https://github.com/libvips/ruby-vips/blob/master/lib/vips.rb#L13-L45 This then runs here in ffi: https://github.com/ffi/ffi/blob/master/lib/ffi/library.rb#L34-L112 As you can see, it'll first try https://github.com/ffi/ffi/blob/master/lib/ffi/library.rb#L129 You can see it has various possible directories wired into the code. If you're lucky, one of these will happen to be correct and it'll work. Homebrew on apple silicon uses a directory that's NOT on that list, so it'll always fail. I think the best solution is to get your system library lookup working. Try If you look on ffi, you'll find several PRs which attempt to improve this unfortunate situation. ioquatix has tried, and there are others in the list as well: |
Looking at @jcupitt 's comments, I went to ffi/ffi#968 and to the forked library. From there, I went to
Yields 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. |
Oh nice @Merovex. If you have time, I'd post a patch to that ffi issue as an example of what's fixed it for you. It might help the devs there. |
The text was updated successfully, but these errors were encountered: