Ruby on Rails project deploy failure: Ruby version on Render issue

Hello,

I tried deploying my Ruby on Rails project based on the guidelines provided under the Go Production Ready section of the Render web page below:

But during the deployment of the web service I encountered a Ruby version error related to one of my gem dependencies as shown in the logs below:

The ruby version I am using in my local development environment is Ruby 3.1.3 and the application runs fine on it.
However, I suspect the version being used on the virtual machine(Render production environment) is the one causing the issue and is currently version 2.6.8(see log message), which is lower than the minimum 2.7.1 version.
My render app is hosted at https://mysite-f7t4.onrender.com/

Is there a way this can be upgraded to the same version as my development environment(Ruby 3.1.3) so that I can install the gems and see if the project runs successfully after?

Actually, after a bit of research I think I have found it:

I didn’t know Render uses Ruby version 2.6.8 as the default version in its native environment.
I wonder what criteria informed this decision.

Anyway, let me try and see if this will work then give an update.

Hi,

I’ve replied to the ticket you also opened, for completeness, I’ll add the same response:

Ensure you’re Specifying a Ruby Version

Also, you may want to tidy up the other warning too:

Your Gemfile lists the gem pg (>= 0) more than once.You should probably keep only one of them.Remove any duplicate entries and specify the gem only once.

Kind regards

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.