You may have encountered a bug in the Ruby interpreter or extension libraries.

元嘉木
2023-12-01

环境: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



作者:Zero_皮皮虾
链接:https://www.jianshu.com/p/56c48553de9e
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

 类似资料:

相关阅读

相关文章

相关问答