build-image
build-image copied to clipboard
provide ruby 3.0.0 support
Currently, using the latest Xenial build image, one is unable to use the released-christmas-day Ruby 3.0.0. When trying to follow the documentation and setting a .ruby-version file with the string 3.0.0
in it, this is what occurs:
6:06:19 PM: Unknown ruby interpreter version (do not know how to handle): 3.0.0.
6:06:19 PM: Attempting ruby version 3.0.0, read from .ruby-version file
6:06:20 PM:
6:06:20 PM: ** WARNING **
6:06:20 PM: Using custom ruby version 3.0.0, this will slow down the build.
6:06:20 PM: To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.
6:06:20 PM: Included versions: 2.7.1 2.6.2
6:06:20 PM:
6:06:20 PM: Unknown ruby interpreter version (do not know how to handle): 3.0.0.
6:06:20 PM: Failed to install ruby version '3.0.0'
6:06:20 PM: Build was terminated: Build script returned non-zero exit code: 1
6:06:20 PM: Failing build: Failed to build site
I believe an update to rvm has provided 3.0.0 support as I can run locally:
% rvm list known | grep 3 | grep 0.0
[ruby-]3[.0.0]
% rvm version
rvm 1.29.11 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
But in Xenial, an older version does not see that release:
$ rvm list known ; rvm version
[...]
11:24:36 AM: # MRI Rubies
11:24:36 AM: [ruby-]1.8.6[-p420]
11:24:36 AM: [ruby-]1.8.7[-head] # security released on head
11:24:36 AM: [ruby-]1.9.1[-p431]
11:24:36 AM: [ruby-]1.9.2[-p330]
11:24:36 AM: [ruby-]1.9.3[-p551]
11:24:36 AM: [ruby-]2.0.0[-p648]
11:24:36 AM: [ruby-]2.1[.10]
11:24:36 AM: [ruby-]2.2[.10]
11:24:36 AM: [ruby-]2.3[.8]
11:24:36 AM: [ruby-]2.4[.9]
11:24:36 AM: [ruby-]2.5[.7]
11:24:36 AM: [ruby-]2.6[.5]
11:24:36 AM: [ruby-]2.7[.0]
11:24:36 AM: ruby-head
[...]
11:24:36 AM: rvm 1.29.10 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
Looking at the release notes for rvm 1.29.11, bumping from 1.29.10 (current version in xenial) to 1.29.11 (latest) should fix this.
First requested in community, here: https://community.netlify.com/t/support-for-ruby-3-0/29400 I see about 20 separate attempts to use it since christmas day in our internal logs (cf this internal slack thread which has a link that you can use to assess for the most recent time window at a later point in time)
Rebuilding the base image will get us the latest rvm
version (it's not pinned), so I suspect we'll get this for free with our next release.
I do not need ruby 3.0.0 support, but it would be very nice if netlify updated the latest pre-installed ruby versions, or cached ruby installs between runs.
We're currently experience very slow builds because netlify needs to build ruby 2.7.4 (latest patch level on offer, our corporate standard) on each and every deployment.
Here's an example re: how long this takes / how much it is slowing down deployments for us.
11:17:49 AM: Installing Ruby from source to: /opt/buildhome/.rvm/rubies/ruby-2.7.4, this may take a while depending on your cpu(s)...
11:17:49 AM: ruby-2.7.4 - #downloading ruby-2.7.4, this may take a while depending on your connection...
11:17:49 AM: No checksum for downloaded archive, recording checksum in user configuration.
11:17:53 AM: ruby-2.7.4 - #extracting ruby-2.7.4 to /opt/buildhome/.rvm/src/ruby-2.7.4.....
11:18:35 AM: ruby-2.7.4 - #configuring........................................................................
11:18:35 AM: ruby-2.7.4 - #post-configuration..
11:22:13 AM: ruby-2.7.4 - #compiling............................................................................................
11:22:17 AM: ruby-2.7.4 - #installing.................
11:22:17 AM: ruby-2.7.4 - #making binaries executable...
11:22:18 AM: Installed rubygems 3.1.6 is newer than 3.0.9 provided with installed ruby, skipping installation, use --force to force installation.
11:22:18 AM: ruby-2.7.4 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.4@global
11:22:21 AM: ruby-2.7.4 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems......................................................................
11:22:21 AM: ruby-2.7.4 - #generating global wrappers........
11:22:21 AM: ruby-2.7.4 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.4
11:22:21 AM: ruby-2.7.4 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
11:22:22 AM: ruby-2.7.4 - #generating default wrappers........
11:22:22 AM: ruby-2.7.4 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
11:22:22 AM: Install of ruby-2.7.4 - #complete
11:22:22 AM: Ruby was built without documentation, to build it run: rvm docs generate-ri
11:22:22 AM: Using /opt/buildhome/.rvm/gems/ruby-2.7.4
11:22:23 AM: Using ruby version 2.7.4
11:22:23 AM: Using bundler version 2.2.21 from Gemfile.lock
11:22:24 AM: Successfully installed bundler-2.2.21
11:22:24 AM: 1 gem installed
We now support ruby 3.0.0 and newer ones. We're not provided them pre-installed, but that'd be another issue. Closing this one as done.