It seems that Render's Ruby version detection via the Gemfile (i.e. if there's no .ruby-version file) does not take into account file references - a feature that Bundler supports itself.
i.e. I have
ruby file: ".tool-versions"
in my Gemfile, and it understands the syntax of ASDF's file, and reads the appropriate version out. When my services try to build, though, they mistake that filename as the version number:
Using Ruby version ".tool-versions" via /opt/render/project/src/Gemfile
...
!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/ruby-".tool-versions"/versions.txt to /opt/render/.cache/ruby-install/ruby-".tool-versions"/versions.txt!
Given Gemfile.lock has the computed version number, perhaps that could be referred to instead of relying on parsing the Ruby code in a Gemfile? (And ditto for gems.locked instead of gems.rb). Or even, use the .tool-versions file as a version source?
I've tweaked the internal
ruby-env.sh
file to cover both of these scenarios, hopefully it's useful: