【问题标题】:Apache with passenger gives error(Premature end of script headers) in development mode带乘客的 Apache 在开发模式下给出错误(脚本头过早结束)
【发布时间】:2011-12-02 07:11:34
【问题描述】:

我正在为我的 rails 应用程序使用 Apache + Passenger,该应用程序在生产模式下运行良好,除非浏览器在开发模式下每 2-3 次点击后显示错误消息,当我刷新页面时会关闭。我'我在我的 Rails 应用程序中使用金属,我认为这可能是原因,但不确定是否是唯一原因。

浏览器上的错误消息:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.16 (Ubuntu) 服务器在 localhost 端口 80

Apache 日志错误:

[Thu Dec 01 16:55:23 2011] [error] [client 127.0.0.1] Premature end of script headers: view_transactions, referer: http://localhost/admin_portal/1014978061/view_transactions
[ pid=660 thr=3078097552 file=ext/apache2/Hooks.cpp:822 time=2011-12-01 16:55:23.563 ]: The backend application (process 796) did not send a valid HTTP response; instead, it sent nothing at all. It is possible that it has crashed; please check whether there are crashing bugs in this application.
[ pid=796 thr=-608495398 file=utils.rb:176 time=2011-12-01 11:25:23.878 ]: *** Exception NoMethodError in application (undefined method `new' for Rails:Module) (process 796, thread #<Thread:0xb77631b4>):
from /home/brijendra/aptana_studio_3_workspace/wantsa/vendor/plugins/newrelic_rpm/lib/new_relic/control.rb:467:in `new_instance'
from /home/brijendra/aptana_studio_3_workspace/wantsa/vendor/plugins/newrelic_rpm/lib/new_relic/control.rb:54:in `instance'
from /home/brijendra/aptana_studio_3_workspace/wantsa/vendor/plugins/newrelic_rpm/lib/new_relic/agent.rb:167:in `logger'

如果需要,我很乐意发布任何其他输出以及解决此问题的建议。

【问题讨论】:

  • 您的 Ruby、Rails 和 NewRelic 版本是什么?这些之间可能存在不兼容。
  • ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux], Rails 2.3.4, newrelic v2.12.3

标签: ruby-on-rails apache2 passenger


【解决方案1】:

我通过在 development.rb 中将缓存更改为 true 来修复此错误,并且效果很好。

【讨论】:

    猜你喜欢
    • 2011-05-28
    • 2017-07-22
    • 2013-07-09
    • 1970-01-01
    • 2011-03-19
    • 2012-12-03
    • 1970-01-01
    • 2014-06-03
    相关资源
    最近更新 更多