0

我的服务器设置适用于 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 错误日志:

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 生产日志:

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 文件放入公共目录中,我可以看到。但是当我想转到应用程序的根路径时它失败了。有任何想法吗?

4

1 回答 1

2

好的,所以这有点尴尬。为了进一步排除我的应用程序故障,我在本地机器上以生产模式启动,当我加载应用程序时,我在网页上收到以下错误:

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

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

于 2014-10-13T21:09:55.907 回答