I’ve a blog site that is built using a Ruby gem.
Site name: non-compos-mentis
It seems Netlify is installing the Ruby version specified in the netlify.toml RUBY_VERSION = "3.3.2"
, but not honoring it during the build, since I get the error “Your Ruby version is 2.7.2, but your Gemfile specified ~> 3.3”.
Gemfile
source "https://rubygems.org"
# Version to be installed is specified in netlify.toml
ruby "~> 3.3"
gem "jekyll", "~> 4"
gem "jekyll-include-cache"
gem "jekyll-archives"
gem "minimal-mistakes-jekyll"
gem "html-proofer", "~> 5"
gem "jemoji"
gem "kramdown", "~> 2"
gem 'kramdown-parser-gfm'
Build Logs
Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
Your Ruby version is 2.7.2, but your Gemfile specified ~> 3.3
"build.command" failed
────────────────────────────────────────────────────────────────
Error message
Command failed with exit code 18: ./script/cibuild (https://ntl.fyi/exit-code-18)
Error location
In build.command from netlify.toml:
./script/cibuild
Resolved config
build:
command: ./script/cibuild
commandOrigin: config
environment:
- JEKYLL_ENV
- RUBY_VERSION
publish: /opt/build/repo/public
publishOrigin: config
redirects:
...
Initialization logs clearly show the desired version of Ruby being installed.
12:19:32 AM: Installing Ruby from source to: /opt/buildhome/.rvm/rubies/ruby-3.3.2, this may take a while depending on your cpu(s)...
12:19:32 AM: ruby-3.3.2 - #downloading ruby-3.3.2, this may take a while depending on your connection...
12:19:32 AM: No checksum for downloaded archive, recording checksum in user configuration.
12:19:33 AM: ruby-3.3.2 - #extracting ruby-3.3.2 to /opt/buildhome/.rvm/src/ruby-3.3.2.....
12:20:02 AM: ruby-3.3.2 - #configuring..................................................................
12:20:02 AM: ruby-3.3.2 - #post-configuration..
12:21:57 AM: ruby-3.3.2 - #compiling........................................................................................................
12:22:02 AM: ruby-3.3.2 - #installing......................
12:22:02 AM: ruby-3.3.2 - #making binaries executable...