Skip to content
Latchkey

rbenv "definition not found" for a Ruby version in CI

rbenv install delegates to the ruby-build plugin, which ships a definition file per Ruby version. When you ask for a version newer than the installed ruby-build knows, it reports "definition not found" and cannot build it.

What this error means

rbenv install <version> fails with "ruby-build: definition not found: <version>". The pinned Ruby is too new for the ruby-build plugin available on the runner.

bundler
ruby-build: definition not found: 3.3.4

See all available versions with `rbenv install --list`.
If the version you need is missing, try upgrading ruby-build:
  git -C ~/.rbenv/plugins/ruby-build pull

Common causes

ruby-build is outdated

The plugin predates the requested Ruby release, so it has no definition file to build that version.

A typo in the version string

A non-existent version (wrong patch, transposed digits) has no matching definition.

How to fix it

Update ruby-build

Pull the latest definitions so the version becomes installable.

Terminal
git -C "$(rbenv root)/plugins/ruby-build" pull
rbenv install --list | grep 3.3
rbenv install 3.3.4

Prefer setup-ruby on GitHub Actions

setup-ruby provisions current Ruby versions without managing ruby-build yourself.

.github/workflows/ci.yml
- uses: ruby/setup-ruby@v1
  with:
    ruby-version: '3.3.4'

How to prevent it

  • Keep ruby-build current so new Ruby releases are installable.
  • Prefer setup-ruby on GitHub Actions to avoid stale ruby-build definitions.
  • Double-check the exact version string against rbenv install --list.

Related guides

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