【发布时间】:2017-01-26 21:29:05
【问题描述】:
我正在尝试从 SQLite 迁移到 Postgres,以便应用在 Heroku 上正确部署。但我没有任何运气。
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
我是 Postgres 的新手,但我尝试了所有遇到的建议,但都没有运气。这是我的 database.yaml 文件:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
timeout: 5000
host: localhost
username: postgres
password: postgres
development:
<<: *default
database: app_development
test:
<<: *default
database: app_test
production:
<<: *default
database: app_production
我相信我正确设置了 Postgres 列表中的空数据库,但运行 rake db:migrate 失败。
非常感谢任何帮助。
【问题讨论】:
标签: ruby-on-rails postgresql sqlite heroku cloud9