Having issue connecting Render hosted Rails application to postgres on Render

I am trying to connect a Rails application on Render with a Postgres db also on Render.

When I try to run the migrations during my application build I get the following error: PG::ConnectionBad: could not translate host name ‘host-name’ to address: Name or service not known. Where ‘host-name’ is my pg database’s host name.

I am using the database url generated by Render for use with applications hosted on Render, but it seems that it’s not working. I have a YAML set up linking my application with the database.

I would truly appreciate any help!

@Tommy_Lawrence It looks like your service is hosted in Oregon and your database in Frankfurt. This was likely an accident in the YAML file, leaving the service’s region empty and it defaulted to Oregon.

1 Like