My site (site name: skeema) is built using Hugo. Today I switched it from build image Trusty to Focal. (I skipped over Xenial, never used it.)
My builds immediately started failing due to inability to install an old Ruby version (2.3.6). This doesn’t make sense to me, since my builds don’t directly use Ruby at all and I’m not requesting an old Ruby version anywhere.
Reviewing the build logs, besides Ruby I also see old versions of other software: Go 1.10, Node 8.17.0. I don’t specify any of these in my env vars – literally the only thing I set was HUGO_VERSION.
Why is my build using all these old versions by default, rather than the Focal defaults?
It feels like Netlify somehow cached dependency versions from Trusty but isn’t updating them for Focal defaults?
If I explicitly set RUBY_VERSION to 2.6.2, my build starts working again. So I’m leaving that in place for now. But since I don’t directly use Ruby at all, I’d prefer not to keep this in my config.
Here’s the log of the failing build (prior to explicitly setting RUBY_VERSION) even when doing a cache-clearing build:
11:59:44 AM: Build ready to start
11:59:46 AM: build-image version: 3802cb5fb68688f5cbd80f2e312aa0ce78813b3a
11:59:46 AM: build-image tag: v4.0.4
11:59:46 AM: buildbot version: 487f6d01b44481b4d57253f3d6071f198697110f
11:59:46 AM: Fetching cached dependencies
11:59:46 AM: Failed to fetch cache, continuing with build
11:59:46 AM: Starting to prepare the repo for build
11:59:47 AM: No cached dependencies found. Cloning fresh repo
11:59:47 AM: git clone https://github.com/ [REDACTED private repo]
11:59:48 AM: Preparing Git Reference refs/heads/master
11:59:48 AM: Parsing package.json dependencies
11:59:49 AM: Starting build script
11:59:49 AM: Installing dependencies
11:59:49 AM: Python version set to 2.7
11:59:51 AM: Downloading and installing node v8.17.0…
11:59:51 AM: Downloading https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz…
11:59:51 AM: Computing checksum with sha256sum
11:59:51 AM: Checksums matched!
11:59:53 AM: Now using node v8.17.0 (npm v6.13.4)
11:59:54 AM: Started restoring cached build plugins
11:59:54 AM: Finished restoring cached build plugins
11:59:54 AM: Attempting ruby version 2.3.6, read from environment
11:59:55 AM: Required ruby-2.3.6 is not installed - installing.
11:59:55 AM: Searching for binary rubies, this might take some time.
11:59:55 AM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.3.6.tar.bz2
11:59:55 AM: Checking requirements for ubuntu.
11:59:56 AM: Missing required packages: libssl1.0-dev
11:59:56 AM: RVM autolibs is now configured with mode ‘2’ =>
11:59:56 AM: ‘Allow RVM to use package manager if found, fail if dependencies are missing. This is default.’,
11:59:56 AM: please run rvm autolibs enable
to let RVM do its job or run and read rvm autolibs [help]
11:59:56 AM: or visit RVM: Ruby Version Manager - for more information.
11:59:56 AM: Found undesired packages: libssl-dev
11:59:56 AM: RVM autolibs is now configured with mode ‘2’ =>
11:59:56 AM: ‘Allow RVM to use package manager if found, fail if dependencies are missing. This is default.’,
11:59:56 AM: please run rvm autolibs enable
to let RVM do its job or run and read rvm autolibs [help]
11:59:56 AM: or visit RVM: Ruby Version Manager - for more information.
11:59:56 AM: Requirements installation failed with status: 1.
11:59:56 AM: ruby-2.3.6 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.3.6
11:59:56 AM: Required ruby-2.3.6 is not installed - installing.
11:59:57 AM: Searching for binary rubies, this might take some time.
11:59:57 AM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.3.6.tar.bz2
11:59:57 AM: Checking requirements for ubuntu.
11:59:58 AM: Missing required packages: libssl1.0-dev
11:59:58 AM: RVM autolibs is now configured with mode ‘2’ =>
11:59:58 AM: ‘Allow RVM to use package manager if found, fail if dependencies are missing. This is default.’,
11:59:58 AM: please run rvm autolibs enable
to let RVM do its job or run and read rvm autolibs [help]
11:59:58 AM: or visit RVM: Ruby Version Manager - for more information.
11:59:58 AM: Found undesired packages: libssl-dev
11:59:58 AM: RVM autolibs is now configured with mode ‘2’ =>
11:59:58 AM: ‘Allow RVM to use package manager if found, fail if dependencies are missing. This is default.’,
11:59:58 AM: please run rvm autolibs enable
to let RVM do its job or run and read rvm autolibs [help]
11:59:58 AM: or visit RVM: Ruby Version Manager - for more information.
11:59:58 AM: Requirements installation failed with status: 1.
11:59:58 AM: ruby-2.3.6 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
11:59:58 AM: ruby-2.3.6 - #generating default wrappers…
11:59:58 AM: Error running ‘run_gem_wrappers regenerate’,
11:59:58 AM: please read /opt/buildhome/.rvm/log/1625846398_ruby-2.3.6/gemset.wrappers.default.log
11:59:58 AM: Using /opt/buildhome/.rvm/gems/ruby-2.3.6
11:59:58 AM: Warning! Executable ‘ruby’ missing, something went wrong with this ruby installation!
11:59:58 AM: Warning! Executable ‘gem’ missing, something went wrong with this ruby installation!
11:59:58 AM: Warning! Executable ‘irb’ missing, something went wrong with this ruby installation!
11:59:58 AM: Using ruby version 2.3.6
11:59:58 AM: /opt/buildhome/.rvm/scripts/override_gem: line 19: gem: command not found
11:59:58 AM: Error installing bundler
11:59:58 AM: Build was terminated: Build script returned non-zero exit code: 1
11:59:58 AM: Creating deploy upload records
11:59:58 AM: Failing build: Failed to build site
11:59:58 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
11:59:58 AM: Finished processing build request in 12.086976143s