Question

Active Record error on deployed rails app

I have successfully deployed my rails backend but when trying to login from frontend, getting this error:

ActiveRecord::ConnectionNotEstablished (connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory [mmw] [2022-12-12 16:12:50] Is the server running locally and accepting connections on that socket?

Need help please


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 12, 2022

Hi there,

Are you deploying this on a Droplet on the App Platform with a Managed Postgres cluster?

Note that you need to create the database that you’ve defined in your config file. You can do that by using the following command:

CREATE DATABASE dbname;

After you’ve created your database, you can run your ActiveRecord migrations as normal, bin/rails db:migrate.

Best,

Bobby