M1电脑上pod update 报错解决方案

针对M1 Mac上`pod update`遇到的问题,提供两种解决方案:1. 在pod命令前添加`arch -x86_64`;2. 卸载并重新安装Ruby和CocoaPods,使用`arch -x86_64`重建ffi和CocoaPods,以确保正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

M1电脑上pod update 报错解决方案


错误场景:

在这里插入图片描述

方案一 简单直接的方案

pod命令前添加 arch -x86_64,
如 arch -x86_64 pod update

方案二 重新安装cocoaPods

Answering my own question. I fixed the ffi issue by uninstalling my faulty Ruby version and CocoaPods, then I used the -x86_64 arch to reinstall ffi and CocoaPods.
These are the steps I did to get back to a working state (and to apply the M1 workarounds for ffi):

  1. Uninstall Ruby with: brew uninstall ruby --force
  2. Uninstall CocoaPods. At first, try to list all CocoaPods versions / components with gem list --local | grep cocoapods. Then uninstall them one by one, in my case:
    sudo gem uninstall cocoapods
    sudo gem uninstall cocoapods-core
    sudo gem uninstall cocoapods-downloader
    etc.
  3. As a next step I was able to reinstall ffi and then CocoaPods with:
    sudo arch -x86_64 gem install ffi
    sudo arch -x86_64 gem install cocoapods
    Once done, I could run pod install as expected. Note that I had the Terminal open all the time in standard mode - no Rosetta required
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值