2014-05-02 134 views
0

我試圖在Heroku上編譯資產,但出現此錯誤。我的資產是在本地編譯的,但在Heroku上我無法完成。Heroku無法編譯資產

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? 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/postgresql_adapter.rb:796:in `initialize' 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/postgresql_adapter.rb:796:in `new' 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/postgresql_adapter.rb:796:in `connect' 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/postgresql_adapter.rb:513:in `initialize' 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new' 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection' 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection' 
     /tmp/build_5h4sx2s7f96x/vendor/bundle/ruby/2.0.0/gems/activere 
+0

看看這個:http://stackoverflow.com/questions/16124490/heroku-rails-4-could - 不是 - 連接到服務器的連接,拒絕 – derekyau

回答

0

請確保您有

config.assets.initialize_on_precompile = false 

上的配置文件