1

有谁知道为什么我不能部署我的应用程序?我正在使用与我对其他应用程序所做的完全相同的配置/更改,我可以毫无问题地将其部署到 cc(当然是不同的凭据)。

database.yml

production:
  adapter: postgresql
  encoding: unicode
  reconnect: false
  pool: 3
  database: xxx
  host: horton.elephantsql.com
  port: 5432
  username: xxx
  password: xxx

这是我收到的错误消息:

-----> Preparing app for Rails asset pipeline
   Running: rake assets:precompile
   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?
   /srv/tmp/builddir/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `initialize'
   /srv/tmp/builddir/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `new'
   /srv/tmp/builddir/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `connect'

有什么建议么?

4

1 回答 1

0

由于在推送期间附加凭据尚不可用(它们仅在运行时可用),您必须设置以下选项来告诉 Rails 在资产预编译期间不要尝试初始化数据库。

config.assets.initialize_on_precompile = false if ENV['BUILDPACK_RUNNING']

您可以在此处找到此设置和其他 Rails 相关设置:https ://www.cloudcontrol.com/dev-center/Guides/Ruby/RubyNotes 。

于 2014-04-18T15:24:49.850 回答