Home > Software engineering >  KMM with CocoaPods. Error: cocoapods-generate requires CocoaPods >= 1.5.0
KMM with CocoaPods. Error: cocoapods-generate requires CocoaPods >= 1.5.0

Time:11-17

I'm trying to add a simple CocoaPods dependency to a test kmm project as explained in this tutorial

Unfortunately, I'm getting this error

Executing of 'pod gen --platforms=ios --gen-directory=/Users/par/code/my/MyApplication/shared/build/cocoapods/synthetic/IOS --sources=https://cdn.cocoapods.org /Users/par/code/my/MyApplication/shared/shared.podspec' failed with code 1 and message: 
[!] cocoapods-generate requires CocoaPods >= 1.5.0

How to fix this error?

My setup

cocoapods version: 1.11.2
cocoapods-generate version: 1.4.1

Mac OS Big Sur 11.6

It looks like the version of cocoapods-generate is obsolete. The latest version of the script is 2.2.2

No matter how hard I've tried, I was not able to upgrade cocoapods-generate past 1.4.1 I'm installing it with this command

sudo gem install cocoapods-generate

I have found this piece of info in this issue

The underlying error is that cocoapods-generate at version 2.2.1 cannot be installed on ruby 3, because it depends on cocoapods-disable-podfile-validations ~> 0.1.1,and the only version of cocoapods-disable-podfile-validations satisfying that (0.1.1) needs ruby ~> 2.1.

Have no idea how to solve this puzzle.

CodePudding user response:

Solved this by downgrading ruby to 2.6

brew install rvm
curl -sSL https://get.rvm.io | bash  
rvm install ruby-2.6.0
  • Related