MacOS 11.0.1 中cocoapods报ERROR: While executing gem ... (Gem::Ext::BuildError)

Ignoring ffi-1.12.1 because its extensions are not built. Try: gem pristine ffi --version 1.12.1

出现这个错误,首先可以尝试:

sudo gem pristine ffi

此时终端可能会报一下错误

Restoring gems to pristine condition...
Building native extensions. This could take a while...
ERROR:  While executing gem ... (Gem::Ext::BuildError)
    ERROR: Failed to build gem native extension.

这时,我们看到错误信息显示权限不够,我们可执行

sudo gem install cocoapods --pre

此时会输出如下:

Building native extensions. This could take a while...
Successfully installed ffi-1.13.1
Successfully installed public_suffix-4.0.6
Successfully installed addressable-2.7.0
Successfully installed cocoapods-core-1.10.0
Successfully installed cocoapods-downloader-1.4.0
Successfully installed nanaimo-0.3.0
Successfully installed xcodeproj-1.19.0
Successfully installed cocoapods-1.10.0
Parsing documentation for ffi-1.13.1
Installing ri documentation for ffi-1.13.1
Parsing documentation for public_suffix-4.0.6
Installing ri documentation for public_suffix-4.0.6
Parsing documentation for addressable-2.7.0
Installing ri documentation for addressable-2.7.0
Parsing documentation for cocoapods-core-1.10.0
Installing ri documentation for cocoapods-core-1.10.0
Parsing documentation for cocoapods-downloader-1.4.0
Installing ri documentation for cocoapods-downloader-1.4.0
Parsing documentation for nanaimo-0.3.0
Installing ri documentation for nanaimo-0.3.0
Parsing documentation for xcodeproj-1.19.0
Installing ri documentation for xcodeproj-1.19.0
Parsing documentation for cocoapods-1.10.0
Installing ri documentation for cocoapods-1.10.0
Done installing documentation for ffi, public_suffix, addressable, cocoapods-core, cocoapods-downloader, nanaimo, xcodeproj, cocoapods after 24 seconds
8 gems installed

明显可以看出安装成功,再尝试 pod --version

$ pod --version
1.10.0

好了,问题完美解决。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值