Ruby version from file in Gemfile

published on 9/1/2023

rubygems got couple of PRs merged which will now enable us to read gem version from files with builtin functions itself. It supports the likes of

  • .ruby-version
  • .tool-versions (ASDF)

Each are expected to have it’s own format that is currently being used.

These are available from bundler version 2.4.19

Samples below:

# .ruby-version
3.2.1
# .tool-versions
ruby 3.2.1

References