2014-04-17 3 views
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' 

어떤 제안이?

답변

0

푸시 중에 애드온 자격 증명을 아직 사용할 수 없으므로 (런타임에만 사용할 수 있음) 자산 미리 컴파일 중에 Rails가 데이터베이스를 초기화하지 않도록 지시하려면 다음 옵션을 설정해야합니다.

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

여기 및 기타 레일 관련 설정은 https://www.cloudcontrol.com/dev-center/Guides/Ruby/RubyNotes입니다.

+0

감사하지만 난 내'application.rb'에 이미 코드가 수행 거짓 'config.assets.initialize_on_precompile = ENV [ 'BUILDPACK_RUNNING']' 다른 생각하면? – Cojones

관련 문제