环境:M1芯片
问题:执行pod install 报错
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html
原因:未适配M1架构
解决方法:
sudo arch -x86_64 gem install ffi
Then
arch -x86_64 pod install
仍然报错
报错信息:
LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle, 9): no suitable image found. Did find:
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle: mach-o, but wrong architecture
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
执行 lipo - info /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
输出: arm64
重新安装x86_64版本:sudo arch -x86_64 gem install ffi -v '1.15.3'
lipo -info /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
输出:x86_64
重新执行bundle exec arch -x86_64 pod install
🍻