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

问题描述

使用 postgres.
一直无法推送.

尝试了这个没有任何运气:

config.assets.initialize_on_precompile = false

-----> 为 Rails 资产管道准备应用

 运行:rake assets:precompile耙子中止!无法连接到服务器:连接被拒绝服务器是否在主机127.0.0.1"上运行并接受端口 5432 上的 TCP/IP 连接?

解决方案

接受的答案并没有完全解决这个问题.我试图找到一个解决方案 2-3 个小时没有成功,然后这奏效了:

在您的应用目录中.

heroku labs:enable user-env-compile

它仍然失败?

heroku labs:disable user-env-compileheroku 实验室:启用用户环境编译

然后它对我有用,只需要删除并再次执行.

Rails 4 中不再需要以下配置.编译资产必须在没有它的情况下工作.

config.assets.initialize_on_precompile = false

Using postgres.
Haven't been able to push.

Tried this without any luck:

config.assets.initialize_on_precompile = false
解决方案

The accepted answer did not fully resolve this. I tried to find a solution for 2-3 hours without success, then this worked:

In your app directory.

heroku labs:enable user-env-compile

it is still failing?

heroku labs:disable user-env-compile
heroku labs:enable user-env-compile

Then it worked for me, just had to remove and do again.

The following config is no longer needed in Rails 4. Compiling assets must work without it.

config.assets.initialize_on_precompile = false

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

05-29 18:23
查看更多