【发布时间】:2015-08-22 17:41:22
【问题描述】:
如果我使用 ActiveRecord,我的 puma 配置将建立数据库连接,如 Heroku 指南 Deploying Rails Applications with the Puma Web Server 中所述。
on_worker_boot do
ActiveRecord::Base.establish_connection
end
但是,我使用的是ROM(Ruby 对象映射器)。
我尝试省略on_worker_boot 块,但(可以预见)数据库连接要么未建立,要么未正确建立,并引发以下错误。
PG::ConnectionBad: PQconsumeInput() SSL error: decryption failed or bad record mac
我已经阅读了ROM Setup Guide,但没有看到任何相关内容。
puma如何建立ROM连接?
【问题讨论】: