“从应用程序收到不完整的响应"来自 nginx/乘客 [英] "Incomplete response received from application" from nginx / passenger
问题描述
我尝试通过 capistrano 在 nginx 和 ubuntu 上部署我的 rails 应用程序,就像页面上的教程 https://gorails.com/部署/ubuntu/14.04.但最后我收到一条错误消息:
I tried to deploy my rails app on nginx and ubuntu via capistrano like the tutorial on the page https://gorails.com/deploy/ubuntu/14.04. but at the end i get an error message:
Incomplete response received from application
在我的浏览器中.这可能是乘客的错误,但我怎么知道该怎么做?
in my browser. this is probably an error from passenger, but how can i figure out what to do?
推荐答案
您的 rails_env 产品不需要设置,可能缺少 secret_key_base.
Your rails_env production don't have required set up,probably missing secret_key_base.
打开 /etc/nginx/sites-available/default
并将 rails_env 更改为 development:
Open /etc/nginx/sites-available/default
and change the rails_env to development:
rails_env production;
to
rails_env development;
如果应用正在加载,则不是乘客问题.
生产解决方案:
If the app is loading it's not a passenger issue.
Production Solution:
- 输入您的应用根目录
- 运行:
rake secret
- 复制输出
- 去
/yourapp/config/secrets.yml
- 设置生产
secret_key_base
重新启动乘客应用:
touch /yourapp/tmp/restart.txt
这篇关于“从应用程序收到不完整的响应"来自 nginx/乘客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!