More unexplained ruby versions

Attempting ruby version 2.7.1, read from environment
11:04:36 AM: 
11:04:36 AM: ** WARNING **
11:04:36 AM: Using custom ruby version 2.7.1, this will slow down the build.
11:04:36 AM: To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.
11:04:36 AM: Included versions: 2.3.6 2.2.9 2.4.5 2.4.3 2.6.2 2.5.4

This is confusing - it says Ruby version is read from the environment. What does that mean. I would assume an environment variable or ruby-version but a) I cannot find them set anywhere and 2) the message suggests I set them so they must no be set.

Maybe I’m not looking at all the places the version can be set? What are they?

it would help if the source being used was listed in the log.

I would expect the default ruby version for the image which is Xenial in this case, but I get similar message for thre Trusty image strange version

Yes you’re probably right. They are most probably set in the build image that Netlify uses.

Though 2.6.2 is documented there for both images

There might be a chance it’s not-updated. The latest commit was on Sep 25, 2019. As you can see, this PR was merged: Upgrade preinstalled Ruby version to 2.7.1 by Benaiah · Pull Request #420 · netlify/build-image · GitHub

1 Like

ahah. Indeed the docker config for the image sets it in the env var.

So the warning given in the build log (see above) doesn’t make sense and needs to be corrected and/or 2.7.1 preloaded

Ah, so the default in the docker is 2.7.1 but the preinstalled version is 2.6.2. Thanks for bringing that up and does definitely seem it can be improved. I’ll ask our team to take a look!

Yes, at least for the Xenial image.

It seems both 2.62 and $RUBY_VERISON (2.7.1) are installed

Hi, @slim. You can also manually set your Ruby version and it will be cached between builds so it isn’t installed from scratch each time.

1 Like

Yes, thanks

I think I’ll use 2.6.2 (no 2.6.6?) which appears is pre installed on the Xenial image anyway :slight_smile: (as the docs state)

Hi @slim, our buildbot supports whichever versions of Ruby the rvm does. And as far as I can tell, rvm should support any version of Ruby that is available. In any case, 2.6.2 should be a pretty safe version to stick to. :+1:

1 Like