【发布时间】:2018-01-08 10:59:26
【问题描述】:
我正在尝试通过 Heroku 上的 Rails 应用程序连接到 Amazon RDS Postgres 实例。我已经设置了我的实例,并按照this gist 中的说明进行操作,但是每当我尝试使用我的新设置部署应用程序时,我都会得到:
PG::ConnectionBad: could not connect to server: Connection timed out
在发布时。我可以通过psql 使用以下设置在我的本地计算机上完美连接:
psql -h my-db-name.eu-west-2.rds.amazonaws.com "dbname=db user=username sslrootcert=config/rds-combined-ca-bundle.pem sslmode=verify-full"
即使在我的 Rails 应用程序中本地使用数据库设置也可以正常工作,因此 Heroku 方面似乎存在问题,但我一辈子都想不通。有什么想法吗?
【问题讨论】:
标签: ruby-on-rails postgresql amazon-web-services heroku