Running 'pod install' on a M1 MacBook failed for me due to an ffi issue, as described here.
I followed some of the workarounds (I guess I tried all of them in various order), but now I get a slightly different error:
LoadError - dlopen(/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 9): no suitable image found. Did find:
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.15.0/lib/ffi_c.bundle: mach-o, but wrong architecture
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.15.0/lib/ffi_c.bundle: mach-o, but wrong architecture - /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.15.0/lib/ffi_c.bundle
So, it seems I now have ffi, but with a wrong architecture? How can I fix this? This happens with/without running the terminal in Rosetta mode.
One of the proposed workarounds did not succeed for me, by the way. When I try:
sudo arch -x86_64 gem install ffi
I get:
arch: posix_spawnp: gem: Bad CPU type in executable
Not sure if this is related.