运行“POD安装”在M1的MacBook失败对我来说由于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
Run Code Online (Sandbox Code Playgroud)
所以,似乎我现在有 ffi,但架构错误?我怎样才能解决这个问题?在 Rosetta 模式下运行/不运行终端会发生这种情况。
顺便说一句,建议的解决方法之一对我来说没有成功。当我尝试:
sudo arch -x86_64 gem install ffi
Run Code Online (Sandbox Code Playgroud)
我得到:
arch: posix_spawnp: gem: Bad CPU type in executable
Run Code Online (Sandbox Code Playgroud)
不确定这是否相关。