Passenger(在Apache下,运行Rails应用程序)没有连接到Postgres,但是提供了无用的错误消息

时间:2018-04-30 22:30:03

标签: ruby-on-rails postgresql apache passenger

我想要在CentOS 7Apache 2.4Passenger 5.2.3Rails 5.1.3Ruby 2.3.1下的一台服务器上运行一对应用。一个应用使用PostgreSQL (9.6.5)(另一个使用MySQL)。启动时,一个应用程序显示以下错误:

[ D 2018-04-30 18:18:09.6842 29585/Tq age/Cor/Spa/Spawner.h:713 ]: [App 29639 stdout] !> Error
[ D 2018-04-30 18:18:09.6842 29585/Tq age/Cor/Spa/Spawner.h:713 ]: [App 29639 stdout] !> 
[ E 2018-04-30 18:18:09.7171 29585/Tq age/Cor/App/Implementation.cpp:305 ]: Could not spawn process for application /var/www/html/my_carrier_packets: An error occurred while starting up the preloader.
  Error ID: c1c03884
  Error details saved to: /tmp/passenger-error-ffVmuJ.html
  Message from application: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
 (PG::ConnectionBad)
  /var/www/html/my_carrier_packets/vendor/bundle/ruby/2.3.0/gems/pg-0.21.0/lib/pg.rb:56:in `initialize'
...

错误详细信息”文件在功能上是对上述内容的重述,.s.PGSQL.5432的数据略多,而且我找不到搜索列出的错误ID的内容。< / p>

我错过了什么?需要做什么?

1 个答案:

答案 0 :(得分:0)

事实证明答案是(最终)found here。在this answer中引用了该内容。

因此,回顾一下:如果您在Apache(以及可能的其他Web服务器)下运行Rails,您的数据库配置可能是连接错误的来源。