gem install cocoapods on react native error: cocoapods-core requires Ruby version >= 2.6. The current ruby version is 2.4.1.111

Viewed 246

I have react native project currently using cocoapods v1.10.1 I want to upgrade the version to cocoapods v1.11.2.

When I run the below command

gem install cocoapods

I get this error:

 Error installing cocoapods:
    There are no versions of cocoapods-core (= 1.11.2) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?
    cocoapods-core requires Ruby version >= 2.6. The current ruby version is 2.4.1.111.
1 Answers

update ruby version. and check which ruby do you use it.

so I recommend to use rbenv. it is ruby version manager. and set gem, pod using rbenv ruby version.

Related