【问题标题】:Error while deploying to heroku: rake assets:precompile PG::ConnectionBad: could not connect to server: Connection refused部署到heroku时出错:rake assets:precompile PG::ConnectionBad: could not connect to server: Connection denied
【发布时间】:2015-03-27 16:56:28
【问题描述】:

在尝试将应用程序 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?

我尝试按照文章的步骤进行操作:https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting

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

我还添加了config.assets.initialize_on_precompile = false

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

知道我做错了什么吗?

谢谢!

P.S:我正在使用带有 rails 4.2.0 的 spree 3.0.0

【问题讨论】:

  • 可能你在添加 config.assets.initialize_on_precompile = false 后忘记提交到 git
  • 生产环境中加载的 gemfile 是什么?

标签: ruby-on-rails git heroku deployment


【解决方案1】:

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

然后尝试 git push 到 heroku

【讨论】:

    猜你喜欢
    • 2021-08-11
    • 2015-08-10
    • 1970-01-01
    • 1970-01-01
    • 2017-12-07
    • 2013-04-20
    • 1970-01-01
    • 2020-10-23
    • 1970-01-01
    相关资源
    最近更新 更多