关于iOS的CocoaPods版本冲突的解决方案

2022-09-29 13:01:41 浏览数 (3)

最近,在运行Flutter项目的时候,报了如下一个错误:

代码语言:javascript复制
You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it

意思是,安装了CocoaPods,但它不工作。如果安装CocoaPods的Ruby版本与用于调用它的版本不同,就会发生这种情况。对于上面这个问题,我们只需要下面几步就可以解决: 1,首先查看CocoaPods的版本。

代码语言:javascript复制
pod --version

如果没有安装,使用下面的命令安装:

代码语言:javascript复制
sudo gem install cocoapods

如果是Flutter,还可以能会报如下错误:If with sudo its failing,First download and install brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)",此时需要运行如下命令:

代码语言:javascript复制
 brew install cocoapods
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

0 人点赞