如果我使用的是ActiveRecord,我的puma配置将建立数据库连接,如Heroku指南Deploying Rails Applications with the Puma Web Server中所述。
on_worker_boot do
ActiveRecord::Base.establish_connection
end但是,我使用的是ROM (Ruby Object Mapper)。
我尝试省略on_worker_boot块,但是(可以预见的)数据库连接要么没有建立,要么没有正确建立,并引发了以下错误。
PG::ConnectionBad: PQconsumeInput() SSL error: decryption failed or bad record mac我已经阅读了ROM Setup Guide,但没有看到任何相关内容。
如何在puma中建立ROM连接?
发布于 2015-08-22 17:41:22
解决方案似乎是disconnect网关连接。
on_worker_boot do
ROM.env.gateways[:default].connection.disconnect
endhttps://stackoverflow.com/questions/32153255
复制相似问题