“从应用程序接收到的不完整响应"从nginx/乘客 [英] "Incomplete response received from application" from nginx / passenger
问题描述
我试图通过capistrano像页面 https://gorails.com/上的教程,将我的Rails应用程序通过capistrano部署在nginx和ubuntu上.部署/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
- Enter your app root
- run:
rake secret
- copy the output
- go to
/yourapp/config/secrets.yml
- set the production
secret_key_base
重新启动乘客应用程序:
Restart the passenger app :
touch /yourapp/tmp/restart.txt
这篇关于“从应用程序接收到的不完整响应"从nginx/乘客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!