Specifying a Ruby Version

Render’s default Ruby version is listed alongside other natively supported languages in this table.

You can customize the Ruby version for your app by adding a .ruby-version file or by setting the ruby directive in your Gemfile. If a version is set in both places .ruby-version will take priority.

To avoid any version mismatch confusion it can help to a single version set in .ruby-version and have the Gemfile read from it, for example:

Your .ruby-version could look like this:

3.1.2

Then the Gemfile can reference .ruby-version via the ruby directive:

ruby File.read('.ruby-version').strip