【发布时间】:2021-04-26 13:45:56
【问题描述】:
我目前正在尝试通过 Heroku 部署我的 Rails 应用程序。为此,我需要从 sqlite3 切换到 postgresql。我这样做并尝试通过执行“rails s”来测试运行该应用程序。但是,我的浏览器出现以下错误:
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"?
也说明这里发生了错误:
### Convenience alias for PG::Connection.new.
def self::connect( *args )
return PG::Connection.new( *args ) <<< (error in this line)
end
任何帮助将不胜感激。谢谢!
【问题讨论】:
-
为什么首先需要上述方法?在 Heroku 上设置 PostgreSQL 通常不需要任何额外的方法和复杂的配置。你跟着什么教程? Heroku 上的官方一篇如何在 Heroku 上添加 PostgreSQL,devcenter.heroku.com/articles/… ?
标签: ruby-on-rails ruby heroku heroku-postgres