Your Ruby version is X, but your Gemfile specified Y Ruby / Rails Origin: Application & API OSI layer 7 · Application Last updated 5 Nov 2026

Bundler: Your Ruby version is 3.1.2, but your Gemfile specified 3.3.0

.ruby-version/the Gemfile ruby line requires a different Ruby than the one running.

Exact message you may see Your Ruby version is 3.1.2, but your Gemfile specified 3.3.0Your Ruby version is X, but your Gemfile specified Yruby version mismatch Gemfile .ruby-versionrbenv: version `3.3.0' is not installed (set by /app/.ruby-version)
Seen on: Ruby

Meaning

Install and activate the right Ruby (rbenv install 3.3.0 && rbenv local 3.3.0, rvm use, asdf), or update the Gemfile and .ruby-version consistently. In Docker use the same base image tag. Run ruby -v and which ruby to confirm what's active.

Common causes

  • Wrong Ruby active (system Ruby)
  • rbenv/rvm not initialised in the shell
  • Gemfile ruby and .ruby-version disagree
  • CI image uses another Ruby
  • Version bumped but not installed

⚡ Quick fix

  1. rbenv install $(cat .ruby-version) && rbenv local $(cat .ruby-version)
  2. Ensure eval "$(rbenv init -)" is in your shell rc
  3. Align Gemfile/.ruby-version/Docker tag

Detailed fix by platform

Ruby

  1. ruby -v; which ruby; cat .ruby-version; grep '^ruby' Gemfile

How to diagnose

  1. Active — ruby -v?
  2. Required — Gemfile/.ruby-version?
  3. Manager — rbenv/rvm initialised?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

ArgumentError: missing keyword / unknown keyword — Ruby: ArgumentError: missing keyword: :name / unknown keyword: :nmae (Ruby / Rails)ArgumentError: missin…ArgumentError: wrong number of arguments (given 1, expected 2) — Ruby: ArgumentError: wrong number of arguments (given 1, expected 2..3) (Ruby / Rails)ArgumentError: wrong …Bundler could not find compatible versions for gem — Bundler: Bundler could not find compatible versions for gem "activesupport": In Gemfile: rails (= 7.1.0) depends on activesupport (= 7.1.0) (Ruby / Rails)Bundler could not fin…Bundler: Could not find gem in locally installed gems — Bundler: Could not find gem 'rails (~> 7.1)' in locally installed gems / Could not find rails-7.1.0 in any of the gem sources listed in your Gemfile (Ruby / Rails)Bundler: Could not fi…client version is too new — Error response from daemon: client version 1.45 is too new. Maximum supported API version is 1.41 (Docker)client version is too…LoadError: cannot load such file — Ruby: LoadError: cannot load such file -- nokogiri (or: cannot load such file -- bundler/setup) (Ruby / Rails)LoadError: cannot loa…Nokogiri: could not find a platform gem / libxml2 build error — Bundler: Your bundle only supports platforms ["x86_64-linux"] but your local platform is arm64-darwin / Could not find gem 'nokogiri (1.16.0-arm64-darwin)' (Ruby / Rails)Nokogiri: could not f…You don't have write permissions for the /Library/Ruby/Gems directory — macOS: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory (macOS)You don't have write …Your Ruby…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.