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.6Common 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
- Read the "Available versions" list in the error.
- Update ruby-version (or .ruby-version) to a version that exists for the runner.
- 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@v1How 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
Bundler "Your Ruby version is 3.x, but your Gemfile specified 3.y" in CIFix Bundler "Your Ruby version is 3.x, but your Gemfile specified 3.y" in CI - the runner Ruby does not match…
Bundler "you must use Bundler 2.x" BUNDLED WITH mismatch in CIFix Bundler "you must use Bundler 2.x to run this bundle" in CI - the runner Bundler version differs from the…
Bundler "the dependencies in your gemfile changed" (frozen mode) in CIFix Bundler frozen mode "the dependencies in your gemfile changed" in CI - the Gemfile was edited but Gemfile…