Skip to content
Latchkey

CocoaPods "activesupport requires Ruby version" in CI

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.

How to fix it

Pin a compatible Ruby version

Set up a Ruby new enough for current CocoaPods.

.github/workflows/ci.yml
- uses: ruby/setup-ruby@v1
  with:
    ruby-version: '3.3'
- run: gem install cocoapods

Or pin an older CocoaPods for an old Ruby

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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →