最近打算做一个React-Native的Demo,在ios目录下执行pod install的时候有如下报错:
369 /Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon/curls/form_options.rb
370 /Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon/curls/messages.rb
371 /Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon/curls/functions.rb
372 /Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon/curls/constants.rb
373
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon/curls/settings.rb
[NOTE] 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 [IMPORTANT] Don't forget to
include the Crash Report log file under DiagnosticReports directory in
bug reports.
zsh: abort pod install
方法一:重新安装x86版本
先执行sudo arch -x86_*64 gem install ffi
然后执行
arch -x86*_64 pod install
方法二:适配Arm版本
首先简单了解下Rosetta Rosetta是苹果电脑公司发布的在Mac OS X上的一个二进制编译器软件,旨在连接英特尔和苹果处理器之间的过渡。简而言之,它会翻译为英特尔开发的应用程序,这样它们就可以在苹果的硅芯片上运行。
- 在Finder中Application文件夹下找到Terminal
- 右击->显示简介->选中“使用Rosetta打开”
- 关闭所有活跃的终端窗口然后再次打开它
- 运行命令 sudo gem install ffi
- 然后再次运行 pod install