P
P
Puma Thailand2016-02-01 13:32:37
PostgreSQL
Puma Thailand, 2016-02-01 13:32:37

Why does ROR not connect to postgresql database after database restart?

Today I found something strange, restarted postgres
service postgresql restart
and found that the Ruby frontend can't connect to the database
AND throws errors:

ActiveRecord::StatementInvalid (PG::UnableToSend: no connection to the server

It helps to restart the application, although as far as I remember this did not happen before.
The application runs on nginx/1.8.0 + passenger 5.0.18 + ruby ​​2.2.3p173
Applications that run on pure ruby ​​without a passenger connect normally, I also connect easily to postgres from the console.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Prigozhenkov, 2016-02-11
@Waka_Waka

Try to see what happens if you set in the configs
config.cache_classes = false

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question