Skip to content

/errors/bundler/your-ruby-version-is-but-your-gemfile-specified

Your Ruby version is 3.2.2, but your Gemfile specified 3.3.0

The commands on this page have not been executed by our verification runner yet.updated
tool
Bundler
exit code
18
versions
Bundler 2.x
os
linux, macos, windows

Your Ruby version is 3.2.2, but your Gemfile specified 3.3.0 means the Gemfile pins a Ruby version with a ruby "3.3.0" line, and the ruby that runs Bundler is a different version. Bundler stops before installing or loading any gem. Switch to the required Ruby with your version manager (rbenv local 3.3.0, asdf set ruby 3.3.0, rvm use 3.3.0) and run bundle install again, or change the ruby line if the project should use your version.

Check which Ruby is active

bash
ruby -v                  # the version Bundler sees
which ruby               # is it the version manager's shim or /usr/bin/ruby?
cat .ruby-version        # what the version manager should select
grep -n '^ruby' Gemfile  # what Bundler requires

Fix with a version manager

ManagerInstallSelect for this project
rbenvrbenv install 3.3.0rbenv local 3.3.0 (writes .ruby-version)
asdfasdf install ruby 3.3.0asdf set ruby 3.3.0 (writes .tool-versions; asdf before 0.16: asdf local ruby 3.3.0)
rvmrvm install 3.3.0rvm use 3.3.0
chruby + ruby-installruby-install ruby 3.3.0chruby 3.3.0 (or auto-switch with .ruby-version)

After switching, install the gems for that Ruby (each Ruby version has its own gem directory):

bash
gem install bundler      # if this Ruby has no Bundler of the version in Gemfile.lock
bundle install

One source of truth

Gemfile
source "https://rubygems.org"

ruby file: ".ruby-version"   # read the version from .ruby-version

With this form, the version lives only in .ruby-version, which version managers and CI setup actions already read. On older Bundler versions use ruby "3.3.0" and keep both files identical. Gemfile.lock also records the Ruby version under RUBY VERSION.

Sources