# More unexplained ruby versions

**URL:** <https://answers.netlify.com/t/more-unexplained-ruby-versions/27673>\
**Category:** Support\
**Tags:** building, deployment\
**Created:** [December 4, 2020, 11:17am UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673 "2020-12-04T11:17:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![slim](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/slim/32/14614_2.png) [@slim](https://answers.netlify.com/u/slim)\
**Post date:** [December 4, 2020, 11:17am UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/1 "2020-12-04T11:17:40Z")

</div>

```auto
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

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [December 4, 2020, 12:02pm UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/2 "2020-12-04T12:02:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![slim](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/slim/32/14614_2.png) [@slim](https://answers.netlify.com/u/slim)\
**Post date:** [December 4, 2020, 12:19pm UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/3 "2020-12-04T12:19:17Z")

</div>

Though 2.6.2 is documented there for both images

> <https://github.com/netlify/build-image/blob/trusty/included_software.md>

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [December 4, 2020, 12:22pm UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/4 "2020-12-04T12:22:01Z")

</div>

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](https://github.com/netlify/build-image/pull/420)

---

<div class="post-metadata">

**Author:** ![slim](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/slim/32/14614_2.png) [@slim](https://answers.netlify.com/u/slim)\
**Post date:** [December 4, 2020, 12:23pm UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/5 "2020-12-04T12:23:50Z")

</div>

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

> <https://github.com/netlify/build-image/blob/xenial/Dockerfile#L263-L269>

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

---

<div class="post-metadata">

**Author:** ![Dennis](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dennis/32/34_2.png) [@Dennis](https://answers.netlify.com/u/Dennis)\
**Post date:** [December 7, 2020, 5:54pm UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/6 "2020-12-07T17:54:14Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![slim](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/slim/32/14614_2.png) [@slim](https://answers.netlify.com/u/slim)\
**Post date:** [December 7, 2020, 7:30pm UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/8 "2020-12-07T19:30:10Z")

</div>

Yes, at least for the Xenial image.

It seems both 2.62 and $RUBY\_VERISON (2.7.1) are installed

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [December 16, 2020, 7:15am UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/9 "2020-12-16T07:15:01Z")

</div>

Hi, @slim. You can also [manually set your Ruby version](https://docs.netlify.com/configure-builds/manage-dependencies/#ruby) and it will be cached between builds so it isn’t installed from scratch each time.

---

<div class="post-metadata">

**Author:** ![slim](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/slim/32/14614_2.png) [@slim](https://answers.netlify.com/u/slim)\
**Post date:** [December 16, 2020, 10:15am UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/10 "2020-12-16T10:15:04Z")

</div>

Yes, thanks

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

---

<div class="post-metadata">

**Author:** ![Dennis](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dennis/32/34_2.png) [@Dennis](https://answers.netlify.com/u/Dennis)\
**Post date:** [December 16, 2020, 5:39pm UTC](https://answers.netlify.com/t/more-unexplained-ruby-versions/27673/11 "2020-12-16T17:39:37Z")

</div>

Hi @slim, our buildbot supports whichever versions of Ruby the [rvm](https://github.com/rvm/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. 👍
