CocoaPods "activesupport requires Ruby version" in CI
By Daniel Zoghalchali·Latchkey
CocoaPods depends on activesupport, which requires a recent Ruby. When the runner’s system Ruby is older than that, installing or running CocoaPods fails on the version requirement.
What this error means
gem install cocoapods or pod install fails with "activesupport requires Ruby version >= 3.1.0" (or similar) and the runner’s Ruby is older. It is deterministic until the Ruby version is raised.
gem output
ERROR: Error installing cocoapods:
The last version of activesupport (>= 5.0, < 8) to support your Ruby & RubyGems
was 6.1.7.6. activesupport requires Ruby version >= 3.1.0.
Common causes
System Ruby too old for the gem
CocoaPods’ transitive dependency activesupport requires a newer Ruby than the runner’s default. The old system Ruby cannot install the current CocoaPods.
No Ruby version pinned in CI
Without ruby/setup-ruby or a .ruby-version, the job inherits whatever Ruby the image ships, which may be too old.
If you cannot upgrade Ruby, install a CocoaPods version whose dependencies still support it.
Terminal
gem install cocoapods -v 1.12.1
How to prevent it
Pin Ruby with ruby/setup-ruby and a committed .ruby-version.
Keep Ruby aligned with the CocoaPods version you install.
Use Bundler with a Gemfile to lock CocoaPods and its deps.
Frequently asked questions
What causes ""requires Ruby version >= ...""?
CocoaPods’ transitive dependency activesupport requires a newer Ruby than the runner’s default. The old system Ruby cannot install the current CocoaPods.
How do I fix "requires Ruby version >= ..."?
Set up a Ruby new enough for current CocoaPods.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.