Rails 4.2 + NGINX - 应用程序root无法加载

时间:2014-10-13 20:34:52

标签: nginx ruby-on-rails-4.2

我的服务器设置适用于Rails 4.0应用程序,但在4.2应用程序上失败。我收到这个错误:

An error occurred.

Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

NGINX配置:

server {
    listen       80;
    server_name  localhost;
    passenger_enabled on;
    rails_env production;
    root /home/deploy/myapp/current/public;
}

NGINX error.log:

2014/10/13 16:17:06 [error] 9261#0: *9 upstream prematurely closed connection while reading response header from upstream, client: ***.***.***.***, server: localhost, request: "GET / H$

Rails production.log:

W, [2014-10-13T16:11:57.305892 #10891]  WARN -- : Warning. Error encountered while saving cache a4b17298d22d34199795f642dc5b96ec8d58cc6c/orders.css.scssc: can't dump anonymous class #<$

W, [2014-10-13T16:11:57.314170 #10891]  WARN -- : Warning. Error encountered while saving cache a4b17298d22d34199795f642dc5b96ec8d58cc6c/pages.css.scssc: can't dump anonymous class #<C$

W, [2014-10-13T16:11:57.319744 #10891]  WARN -- : Warning. Error encountered while saving cache a4b17298d22d34199795f642dc5b96ec8d58cc6c/registrations.css.scssc: can't dump anonymous c$

如果我在公共目录中手动输入index.html文件,我可以看到。但是当我想要进入应用程序的根路径时它失败了。有什么想法吗?

1 个答案:

答案 0 :(得分:2)

好的,这有点令人尴尬。为了进一步解决我的应用程序问题,我在本地计算机上启动了生产模式,当我加载应用程序时,我在网页上收到以下错误:

Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`

就是这样。我猜我错过了这个新的安全功能,从Rails 4.0直接跳到4.2不确定为什么它没有显示在日志中,但至少我最终找到了它。