在尝试将应用程序 git push 到 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?
我试着按照文章的步骤操作:https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting
我的 Assets 在本地编译,无需连接到数据库。
我还添加了 config.assets.initialize_on_precompile = false
但是在heroku中尝试部署时仍然出现错误...
知道我做错了什么吗?
谢谢!
P.S: 我正在使用带有 rails 4.2.0 的 spree 3.0.0
最佳答案
在 heroku 中为您的应用创建新的数据库:
heroku 插件:创建 heroku-postgresql
然后试试 git push 到 heroku
关于ruby-on-rails - 部署到 heroku 时出错:rake Assets :预编译 PG::ConnectionBad:无法连接到服务器:连接被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29306082/