在 M1 MacBook 上运行 'pod install' 失败了,因为出现了 ffi 问题,如 这里所述。
我尝试了一些解决方法(我想我按不同的顺序都试过了),但现在我得到了一个稍微不同的错误:
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
看起来我现在有了ffi,但是架构不对?我该怎么办?无论是否在Rosetta模式下运行终端都会发生这种情况。
顺便说一句,其中一个提出的解决方法对我没有成功。当我尝试:
sudo arch -x86_64 gem install ffi
我理解为:
arch: posix_spawnp: gem: Bad CPU type in executable
不确定这是否相关。