加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 由于服务器拒绝连接,无法部署到Heroku

发布时间:2020-12-16 19:19:31 所属栏目:百科 来源:网络整理
导读:我想将我的本地Rails应用程序(完美地运行)部署到Heroku,但是收到以下错误消息: rake aborted!could not connect to server: Connection refusedIs the server running on host "127.0.0.1" and acceptingTCP/IP connections on port 5432?/tmp/build_21pkcz
我想将我的本地Rails应用程序(完美地运行)部署到Heroku,但是收到以下错误消息:
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_21pkcz898c28o/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'

其次是关于postgres_adapter的很多行.

我有点失望,因为我认为Heroku覆盖了config / database.yml,所以为什么它谈论在127.0.0.1上运行服务器(我不是在寻找远程数据库)?

谢谢,

更新

如果这有帮助,运行heroku配置将提供以下内容:

DATABASE_URL:               xxx
HEROKU_POSTGRESQL_GRAY_URL: xxx (the same xxx as above)

解决方法

在您的application.rb中包含以下内容,位于Module Appname上方
config.assets.initialize_on_precompile = false

并阅读Heroku Labs: user-env-compile文章

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读