部署到heroku时出错:rake资产:预编译PG :: ConnectionBad:无法连接到服务器:连接被拒绝

use*_*206 3 git deployment ruby-on-rails heroku

在尝试git将应用程序推送到heroku时,我得到了这个特定的错误:

remote:        Running: rake assets:precompile 
remote:        PG::ConnectionBad: could not connect to server: Connection     refused
remote:        Is the server running on host "127.0.0.1" and accepting
remote:        TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)

我试着按照文章的步骤: https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting

我的资产在本地编译而无需连接到数据库.

我也加了 config.assets.initialize_on_precompile = false

但是当尝试在heroku中部署时仍然会出现错误...

我知道我做错了什么吗?

谢谢!

PS:我使用带有rails 4.2.0的spree 3.0.0

Rak*_*esh 7

在heroku中为您的应用创建新数据库: heroku addons:create heroku-postgresql

然后尝试git push to heroku