本地一切正常,但在尝试推送到Heroku时出现了该错误:
正在运行: rake assets:precompile
Connecting to database specified by DATABASE_URL
rake aborted!
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
/tmp/build_1903c764-07ce-4d06-aa45-6e78dec68af8/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
/tmp/build_1903c764-07ce-4d06-aa45-6e78dec68af8/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
我怀疑这与database.yml有关,所以这是它的内容:
development:
adapter: mysql2
encoding: utf8
database: dev-db
pool: 5
timeout: 5000
socket: /tmp/mysql.sock
test:
adapter: mysql2
encoding: utf8
database: test-db
pool: 5
timeout: 5000
socket: /tmp/mysql.sock
production:
adapter: postgresql
encoding: utf8
database: prod-db
pool: 5
timeout: 5000
# socket: /tmp/mysql.sock
heroku config
,是否有任何关于DATABASE_URL
环境变量的引用? - Richard Peck