KMM with CocoaPods. Error: cocoapods-generate requires CocoaPods >= 1.5.0 - macos

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.

Solved this by downgrading ruby to 2.6
brew install rvm
curl -sSL https://get.rvm.io | bash
rvm install ruby-2.6.0

had to run this:
gem install cocoapods-generate

Related

cocoapods's version is 1.11.3 and I want to downgrade with 1.11.2

terminal image
Now, cocoapods's version is 1.11.3 and I want to downgrade with 1.11.2
I used these code to downGrade xcode version.
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.11.2
However, If I used this code, still cocoapods's version is 1.11.3
pod --version
I want to know what should I do now...
Now, cocoapods's version is 1.11.3 and I want to downgrade with 1.11.2 !
Please help me..

Ruby installation (2.1.2) fails in macOS Big Sur(11.2.3)

I am not able to install ruby 2.1.2 on MacBook Pro (16-inch, 2019). I am getting below issue
Downloading ruby-2.1.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2
Installing ruby-2.1.2...
WARNING: ruby-2.1.2 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
BUILD FAILED (macOS 11.2.3 using ruby-build 20210309)
Inspect or clean up the working tree at /var/folders/m8/2rpyp98n6kn0f5628315l8jr0000gn/T/ruby-build.20210319190843.1296.BVeODj
Results logged to /var/folders/m8/2rpyp98n6kn0f5628315l8jr0000gn/T/ruby-build.20210319190843.1296.log
Last 10 log lines:
installing capi-docs: /Users/shodhangk/.rbenv/versions/2.1.2/share/doc/ruby
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/shodhangk/.rbenv/versions/2.1.2
--with-openssl-dir=/usr/local/opt/openssl#1.1
--with-readline-dir=/usr/local/opt/readline
CC=clang
LDFLAGS=-L/Users/shodhangk/.rbenv/versions/2.1.2/lib
CPPFLAGS=-I/Users/shodhangk/.rbenv/versions/2.1.2/include
I looked at this Ruby installation (2.2.2) fails in macOS Big Sur and tried with all below solutions but still, the same issue exists.
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl#1.0/1.0.2t rbenv install 2.1.2
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.1.2
Even tried by slightly changing the ruby versions to 2.1.x and 2.2.x. But no difference.

OpenSSL error installing Ruby 2.1.x and 2.3.x on Archlinux with ruby-install/ruby-build

I've had some problems building older versions of Ruby with ruby-install on Archlinux. I suspect the same is happening with ruby-build. I am seeing the following after trying to install Ruby 2.1.5, 2.1.6, 2.3.0, 2.3.1, 2.3.4.
/usr/include/openssl/asn1_mac.h:10:2: error: #error "This file is obsolete; please update your software."
#error "This file is obsolete; please update your software."
or
ossl_ssl.c:465:38: error: ‘CRYPTO_LOCK_SSL_SESSION’ undeclared
If not already installed you need Open SSL 1.0:
pacman -S openssl-1.0
For installing Ruby 2.3.x the following is needed:
PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig ruby-install ruby 2.3.0
I installed 2.3.0, 2.3.1 and 2.3.4 this way.
I'm using ruby-install but the same probably applies to ruby-build (rbenv).
For Ruby 2.1.x and 2.2.x a patch is also needed:
curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt > ruby2.x-openssl.patch
PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig ruby-install -p ruby2.x-openssl.patch ruby 2.1.5
I installed 2.1.5 and 2.1.6 this way.
For older versions of Ruby (< 2) a different patch may be needed which can be downloaded here:
https://github.com/rbenv/ruby-build/wiki#openssl-sslv3_method-undeclared-error
Corrupted memory and Segfaults when compiling ruby
If you get segfaults when compiling, it might be because of the latest version of gcc. A workaround is to install an older version and then specify it to ruby-install:
sudo pacman -S gcc5
CC=/usr/sbin/gcc-5 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig ruby-install ruby 2.3.0
Reference: https://github.com/rbenv/ruby-build/issues/1092
Same worked for me with Ruby 2.6 and OpenSSL 1.1 using rvm:
pacman --sync --needed openssl-1.1
PKG_CONFIG_PATH=/usr/lib/openssl-1.1/pkgconfig rvm install 2.6

Upgrading Ruby using homebrew on a mac and installing berkshelp

I just finished upgrading my ruby to fit the requirements for berkshelf... at least so i thought... and now when i try to implement berkshelf i throw this error:
ruby-build: use openssl from homebrew
Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
Installing ruby-2.3.1...
Installed ruby-2.3.1 to /Users/meee/.rbenv/versions/2.3.1
meee$ sudo gem install berkshelf
Password:
ERROR: Error installing berkshelf:
buff-extensions requires Ruby version >= 2.2.0.
Has anyone encountered this problem before?
I'm running the newest sierra os build.
You are installing ruby for user meee, but berkshelf for root. It won't work. You should use user ruby all the time.
Maybe use ChefDK, it has berkshelf included and probably all other tools you might need for chef.

Failed to Install Compass 1.0.1 on Ubuntu 14.04

I can't install latest Compass 1.0.1 on Ubuntu 14.04.
$ ruby --version
ruby 2.0.0p384 (2014-01-12) [i386-linux-gnu]
$ gem --version
2.0.14
I'm doing:
$ sudo gem install compass -v 1.0.1
The first error in the log is this:
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
And here's the full log:
https://gist.github.com/slavafomin/055394e379e8252bab9e
I'm installing Ruby via this packages:
ruby2.0
ruby2.0-dev
I even tried to install Ruby via RVM, but I'm getting the same error.
What could be the problem?
Is it possible to install latest version of Compass on Ubuntu 14.04 without RVM?
It looks like problem is actually with ffi extension.
When I've tried to install ffi manually with this command: sudo gem install ffi, it failed with the same error as above. However, when I've specified latest stable version like this: sudo gem install ffi -v 1.9.6 it installed correctly. After that Compass installed like a charm.
I will leave it here if someone will encounter this problem in the future.
Also, this Q/A could be useful:
ERROR: Error installing ffi: ERROR: Failed to build gem native extension
I've posted an issue on FFI's GitHub repository:
https://github.com/ffi/ffi/issues/414

Resources