Error on Database Migrate

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: SSL connection has been closed unexpectedly’.

I am using the database url generated by Render for use with applications hosted on Render. I have a YAML set up linking my application with the database.

Not sure what’s going wrong I have tried with values of pool in my config.yml at 1, 2 and 5.

I would truly appreciate any help!

Similar issue to earlier topic but a different error!