2

I'm unable to use Rails 7.0.3.1 with vips on an M1 MacBook Air due to the error:

rails aborted!
LoadError: Could not open library 'glib-2.0.0': dlopen(glib-2.0.0, 0x0005): tried: 'glib-2.0.0' (no such file), '/usr/local/lib/glib-2.0.0' (no such file), '/usr/lib/glib-2.0.0' (no such file), '/Users/brody/Code/tms.next-tms.com.wip2/glib-2.0.0' (no such file).
Could not open library '/opt/local/lib/libglib-2.0.0.dylib': dlopen(/opt/local/lib/libglib-2.0.0.dylib, 0x0005): tried: '/opt/local/lib/libglib-2.0.0.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))

I'm using ffi 1.15.1 and can see it searching correctly in /opt/local/lib, but the homebrew package builds binaries for x86_64 rather than arm64e even while using the --build-from-source option (brew install vips --build-from-source).

Has anyone got this working?

Brody
  • 51
  • 3
  • 1
    vips should be native m1 with homebrew, see https://formulae.brew.sh/formula/vips --- perhaps your brew needs updating? – jcupitt Sep 12 '22 at 03:22

1 Answers1

1

I ran into the same issue (with libglib-2.0.0) but then I figured that brew poured glib--2.74.5.arm64_monterey.bottle so why does it find 2.0.0? In my case it was (a dated version of) Navicat linking an old glib

~$ ls -l /usr/local/lib/libglib*
0 lrwxr-xr-x  1 chaos  staff    73B Dec 11 11:23 /usr/local/lib/libglib-2.0.0.dylib -> /Applications/Navicat Premium.app/Contents/Frameworks/libglib-2.0.0.dylib

This wasn't the only file however, Navicat linked a total of 71 dylib files. I removed all those symlinks and then the error disappeared

2called-chaos
  • 3,018
  • 3
  • 21
  • 29
  • Had this issue plus a few other lib symlinks to remove - part of the joy of migrating from an older laptop instead of a fresh install :-) – Todd May 29 '23 at 12:39