如果我使用 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 设置指南,但没有看到任何相关内容。
如何在 puma 中建立 ROM 连接?