【问题标题】:Rails app running under Phusion Passenger shows only a white screen在 Phusion Passenger 下运行的 Rails 应用程序仅显示白屏
【发布时间】:2011-09-02 20:13:23
【问题描述】:

我早些时候发布了another question 与Passenger 的部署。这个问题原来是一个权限问题,我通过在 www 文件夹上递归运行 chmod 来修复它。

现在,我没有看到 Phusion 错误页面,但我看到了白屏死机。 Rails 日志没有显示错误消息,我无法弄清楚这里发生了什么。

编辑:这些来自错误日志……至少我认为是这样。无论出于何种原因,所有 error.logs 都已被压缩。页面状态码为 500 Internal Server Error。

SQLite3::CantOpenException (unable to open database file):

SQLite3::CantOpenException (unable to open database file):

EDIT2:最终从服务器得到一些错误输出。 :-P

[Sat Sep 18 17:49:55 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch Phusion_Passenger/3.0.0.pre2 configured -- resuming normal operations
Rails Error: Unable to access log file. Please ensure that /var/www/rails/releases/20100918182135/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: welcomes: SELECT "welcomes".* FROM "welcomes"): app/controllers/welcomes_controller.rb:5:in `index'
ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: welcomes: SELECT     "welcomes".* FROM "welcomes"): app/controllers/welcomes_controller.rb:5:in `index'

【问题讨论】:

  • 请检查并发布您的网络服务器 (nginx/apache) 的 error.log 文件。还要检查真正返回的内容。 HTTP响应的代码是什么?有内容吗?您也可能想检查一下,如果您的 Rails 根目录下的 public/ 中没有 index.html。
  • 我检查了错误日志文件。您不会相信这一点,但日志文件正在被 gzip 压缩,其中有 13 个。我以前从未见过这种情况。页面状态码为 500 Internal Server Error。

标签: ruby-on-rails passenger


【解决方案1】:

您的错误日志可能正在被日志轮换守护程序压缩。这是大多数服务器的标准组件。

无论如何,你得到一个白页,因为正如错误所说,你的数据库文件有问题,可能是另一个权限问题。修复它,它应该可以工作。

【讨论】:

  • 我刚刚清除了所有日志文件并尝试再次点击该页面以复制错误。但是这次它没有生成error.log消息。 (顺便说一句,感谢您迄今为止的所有帮助。)
猜你喜欢
  • 1970-01-01
  • 2010-12-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-12
  • 2014-11-09
  • 2022-06-14
相关资源
最近更新 更多