M1 pod install CocoaPod 报错解决办法

  • Mac M1 pod install 报错解决办法
  • Mac M1 CocoaPods 环境问题
  • M1 Ruby 环境问题

新到的 MacBook Pro M1,配置如下:

MacBook Pro (13-inch, M1, 2020)
系统:macOS Big Sur
芯片 Apple M1
内存 16 GB
存储空间 500 GB

问题

pod install 报错 in M1

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.  
   
-- Control frame information -----------------------------------------------
c:0035 p:---- s:0231 e:000230 CFUNC  :attach

···

[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.

[1]    35542 abort      pod install

pod list get 0 pods were found

0 pods were found

解决

1.打开终端显示简介
2.勾选以Rosetta方式打开
3. 运行 sudo gem install cocoapods (之前安装过就略过
4. 运行 sudo gem install ffi
5.最后pod install

试了下还是报错,之后使用了下面的命令

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
arch -x86_64 pod update

之后在pod install 就可以了。

如果还报

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

···

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+could+not+use+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%27+because+it+is+not+a+compatible+arch+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - pod install has bug
   https://github.com/CocoaPods/CocoaPods/issues/10723 [closed] [9 comments]
   a week ago

https://github.com/CocoaPods/CocoaPods/issues/10723 给出了解决办法

Did you try:

sudo arch -x86_64 gem install ffi

And run:

arch -x86_64 pod install instead of pod install.

I hope this will help you.

参考

[1] Running CocoaPods on Apple Silicon (M1)
[2] Got error while trying pod install

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Morris_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值