因为服务器拒绝连接

因为服务器拒绝连接

本文介绍了无法部署到Heroku,因为服务器拒绝连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  

我想部署我的本地Rails应用程序(完美地工作)到Heroku,但得到以下错误信息:耙子中止了!
无法连接到服务器:连接被拒绝
服务器是否在主机127.0.0.1上运行并接受端口5432上的
TCP / IP连接?
/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



我有点失望,因为H​​eroku覆盖了 config / database.yml ,为什么它会在 127.0.0.1上运行服务器(我不是在寻找远程数据库)?

谢谢,



更新



如果可以提供帮助,请运行 heroku config b>

  DATABASE_URL:xxx 
HEROKU_POSTGRESQL_GRAY_URL:xxx(与上面相同的xxx)


解决方案
在您的application.rb中包含以下内容,位于Module Appname上方

  config.assets.initialize_on_precompile = false 

的d阅读文章

文章

I wanted to deploy my local Rails app (that works perfectly) to Heroku, but get the following error message:

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'

Followed by many lines about postgres_adapter.

I'm a bit disappointed because I red that Heroku overwrite config/database.yml so why does it talk about running the server on 127.0.0.1 (I'm not looking for remote db)?

Thanks,

Update

If this can help, running heroku config gives the following:

DATABASE_URL:               xxx
HEROKU_POSTGRESQL_GRAY_URL: xxx (the same xxx as above)
解决方案

Include the following in your application.rb, above the Module Appname

config.assets.initialize_on_precompile = false

And read the Heroku Labs: user-env-compile Article

这篇关于无法部署到Heroku,因为服务器拒绝连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 07:45