Switching to Ubuntu Focal 20.04 from Xenial crashes build /deploy (old ruby 2.3.6 fails)

Recently switched a site to use the new Ubuntu Focal image. The build crashes upon installing ruby 2.3.6 apparently. What’s quite frustrating is that this site does not even use Ruby. Running on Node / Eleventy. Seems to be a default install of ruby that Netlify wants to make.

The build works fine locally. Rolling back to the Xenial image lets me build/deploy. Tried clearing the cache. No dice.

Note: the site used to be a jekyll site years ago but nothing in the deployed branch of the repo anymore.

Netlify site ID webstoemp

3:27:58 PM: Build ready to start
3:28:05 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
3:28:05 PM: build-image tag: v4.10.1
3:28:05 PM: buildbot version: 9d6a906060ee274aa5720670365f2c94b6c2a475
3:28:06 PM: Building without cache
3:28:06 PM: Starting to prepare the repo for build
3:28:06 PM: No cached dependencies found. Cloning fresh repo
3:28:06 PM: git clone https://github.com/jeromecoupe/webstoemp
3:28:08 PM: Preparing Git Reference refs/heads/master
3:28:08 PM: Parsing package.json dependencies
3:28:09 PM: Starting build script
3:28:09 PM: Installing dependencies
3:28:09 PM: Python version set to 2.7
3:28:10 PM: Downloading and installing node v18.3.0...
3:28:10 PM: Downloading https://nodejs.org/dist/v18.3.0/node-v18.3.0-linux-x64.tar.xz...
3:28:12 PM: Computing checksum with sha256sum
3:28:12 PM: Checksums matched!
3:28:14 PM: Now using node v18.3.0 (npm v8.11.0)
3:28:14 PM: Started restoring cached build plugins
3:28:14 PM: Finished restoring cached build plugins
3:28:14 PM: Attempting ruby version 2.3.6, read from environment
3:28:15 PM: Required ruby-2.3.6 is not installed - installing.
3:28:15 PM: Searching for binary rubies, this might take some time.
3:28:15 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.3.6.tar.bz2
3:28:15 PM: Checking requirements for ubuntu.
3:28:15 PM: Missing required packages: libssl1.0-dev
3:28:15 PM: RVM autolibs is now configured with mode '2' =>
3:28:15 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
3:28:15 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
3:28:15 PM: or visit https://rvm.io/rvm/autolibs for more information.
3:28:15 PM: Found undesired packages: libssl-dev
3:28:15 PM: RVM autolibs is now configured with mode '2' =>
3:28:15 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
3:28:15 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
3:28:15 PM: or visit https://rvm.io/rvm/autolibs for more information.
3:28:15 PM: Requirements installation failed with status: 1.
3:28:15 PM: ruby-2.3.6 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.3.6
3:28:15 PM: Required ruby-2.3.6 is not installed - installing.
3:28:15 PM: Searching for binary rubies, this might take some time.
3:28:16 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.3.6.tar.bz2
3:28:16 PM: Checking requirements for ubuntu.
3:28:16 PM: Missing required packages: libssl1.0-dev
3:28:16 PM: RVM autolibs is now configured with mode '2' =>
3:28:16 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
3:28:16 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
3:28:16 PM: or visit https://rvm.io/rvm/autolibs for more information.
3:28:16 PM: Found undesired packages: libssl-dev
3:28:16 PM: RVM autolibs is now configured with mode '2' =>
3:28:16 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
3:28:16 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
3:28:16 PM: or visit https://rvm.io/rvm/autolibs for more information.
3:28:16 PM: Requirements installation failed with status: 1.
3:28:16 PM: ruby-2.3.6 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
3:28:16 PM: ruby-2.3.6 - #generating default wrappers.................
3:28:16 PM: Error running 'run_gem_wrappers regenerate',
3:28:16 PM: please read /opt/buildhome/.rvm/log/1661174896_ruby-2.3.6/gemset.wrappers.default.log
3:28:16 PM: Using /opt/buildhome/.rvm/gems/ruby-2.3.6
3:28:16 PM: Warning! Executable 'ruby' missing, something went wrong with this ruby installation!
3:28:16 PM: Warning! Executable 'gem' missing, something went wrong with this ruby installation!
3:28:16 PM: Warning! Executable 'irb' missing, something went wrong with this ruby installation!
3:28:16 PM: Using ruby version 2.3.6
3:28:16 PM: /opt/buildhome/.rvm/scripts/override_gem: line 19: gem: command not found
3:28:16 PM: Error installing bundler
3:28:16 PM: Build was terminated: Build script returned non-zero exit code: 1
3:28:16 PM: Creating deploy upload records
3:28:16 PM: Failing build: Failed to build site
3:28:16 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
3:28:16 PM: Finished processing build request in 10.884997588s

Cannot figure out what I can do to fix this.

This also happens with: nicolasbenedit which is another 11ty site.

Build/deploys are working with another 11ty site equalday2019. Node versions are the same but, in this case, the version of Ruby that is used is 2.7.1

Why are these two other sites requiring and trying to install Ruby 2.3.6, I don’t quite understand.

Seems that the solution is to unlink and relink repository.

As per this forum thread, it looks like a version of ruby linked to the old image is pinned by default.

Unlinking and relinking the repository reset the correct default versions for the new image.

On a side note, the linked thread says that Ruby will be automatically set to 2.7.2 upon changing the build image, but I didn’t see that behaviour.

Thank you for coming back and sharing this with us. I am glad you got unblocked and that you found a solution!