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.
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 pullCommon 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.
git -C "$(rbenv root)/plugins/ruby-build" pull
rbenv install --list | grep 3.3
rbenv install 3.3.4Prefer setup-ruby on GitHub Actions
setup-ruby provisions current Ruby versions without managing ruby-build yourself.
- 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.