0
点赞
收藏
分享

微信扫一扫

微软正式发布Copilot for Security

微言记 2天前 阅读 3

MAC安装CocoaPods遇到的错误Failed to build gem native extension.

配置flutter环境的时候报错cocoapods不可用

报错信息

发现已经安装了CocoaPods,但是不能用

重新安装CocaPods

sudo gem install cocoapods

重新安装报错如下:

在这里插入图片描述
安装RVM

curl -L https://get.rvm.io | bash -s stable

使用RVM管理Ruby
先下载ruby

rvm install ruby-2.6

如果你的电脑是M1的,下载过程会出现一些错误;解决办法
点击查看解决办法

再次尝试下载下载

sudo gem install cocoapods

又又又又报错了

ERROR:  Error installing cocoapods:
	The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with `gem install drb -v 2.0.6` and then running the current command again
	drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

这个错误是我目前的Ruby是2.6.10.210版本的,版本比较低
需要下载>=2.7.0版本的
使用ruby管理工具rvm(没安装要先安装)进行下载
查看已经安装的Ruby

rvm list

安装高版本的Ruby

rvm install ruby-2.7.2

下载完成切换到2.7.2版本

rvm use 2.7.2

然后再次下载cocoapods

sudo gem install cocoapods

搞定!!

举报

相关推荐

0 条评论