Nope, unfortunately not:
Aug 12 10:54:24 AM ==> Downloading cache...
Aug 12 10:54:28 AM ==> Downloaded 33MB in 2s. Extraction took 1s.
Aug 12 10:54:31 AM ==> Running build command './bin/build-web.sh'...
Aug 12 10:54:31 AM Your Ruby version is 2.6.5, but your Gemfile specified 3.0.2
Aug 12 10:54:31 AM ==> Build failed 😞
If I had to hazard a guess, I’d say it comes from this part of your build scripts:
and further on:
if [[ -f $rv ]]; then
detected_version=$(head -1 "$rv");
if [[ -z $detected_version && -f $gemfile ]]; then
if [[ -z $detected_version ]]; then
It first looks for a
.ruby-version and then it looks for a file called exactly
Gemfile. Here would be a great place to first look for a
$RUBY_VERSION, right above trying the
The first thing I tried was overriding
DEFAULT_RUBY_VERSION with an environment variable with value of
3.0.2, as well as setting
3.0 but it doesn’t seem to respect it, or maybe by then it is too late? My investigation stopped here because I can’t override
RENDER_PRE_BUILD_CMD and I think that it’s all happening before I can do anything about it.
I’m currently trying another approach where I take more control in the build and start scripts, and I’ll report back.
Of course it would be a lot easier to be able to set
RUBY_VERSION and have that override all of the auto-detection.
Hope that helps!