Skip to content
Latchkey

setup-ruby "The Ruby version X is not installed" in CI

setup-ruby installs Ruby from prebuilt versions for the runner OS. When the pinned version (from ruby-version or .ruby-version) has no prebuilt binary for that runner, the action fails before Bundler runs.

What this error means

The setup-ruby step fails with "The requested Ruby version is not available" or "The Ruby version 3.3.0 is not installed", listing the versions it can provide.

setup-ruby
Error: The requested Ruby version 3.3.9 is not available for ubuntu-22.04.
Available versions: 3.3.0, 3.3.1, ... 3.3.6

Common causes

The pinned version has no prebuilt binary

A very new or patch-level version was requested that setup-ruby does not yet ship for that runner OS.

A typo or nonexistent version in the pin

The ruby-version input or .ruby-version file names a version that does not exist.

How to fix it

Pin an available version

  1. Read the "Available versions" list in the error.
  2. Update ruby-version (or .ruby-version) to a version that exists for the runner.
  3. Re-run so the interpreter provisions.
.github/workflows/ci.yml
- uses: ruby/setup-ruby@v1
  with:
    ruby-version: '3.3.6'

Update the action version

A newer setup-ruby ships newer Ruby builds; bump the action if the version you need is recent.

.github/workflows/ci.yml
- uses: ruby/setup-ruby@v1

How to prevent it

  • Pin Ruby to a patch version setup-ruby actually provides.
  • Keep .ruby-version aligned with what the runner OS supports.
  • Bump setup-ruby when adopting a brand new Ruby release.

Related guides

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