【发布时间】:2018-07-05 07:12:54
【问题描述】:
我有一个在 heroku 上运行的 ruby 应用程序,我正在尝试将它连接到 Heroku postgres 数据库。我已经安装了附加组件并捆绑了“pg”gem。我试着跑了
PG.connect(dbname:d6td9jdn7irk0u)
只会导致:
PG::ConnectionBad: could not connect to server: No such file or directory. Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
我的问题是:我怎样才能正确建立连接?我应该向 connect() 函数提供用户/密码吗?
我在网上搜索时能找到的所有内容都是关于使用 ruby on rails 遇到类似问题的人
【问题讨论】:
-
感谢您的帮助。这个问题不是重复的,我没有在 Rails 或 ActiveRecord 上使用 ruby。这个问题只发生在heroku上
标签: ruby postgresql heroku pg heroku-postgres