间歇"脚本头和QUOT的premature结束;用Rails 3.1 [英] Intermittent "premature end of script headers" with Rails 3.1

查看:170
本文介绍了间歇"脚本头和QUOT的premature结束;用Rails 3.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

于是我开始从Rails的升级我们的应用程序,以3.1的Rails 3.0.9。

So I've started upgrading our app to Rails 3.1 from Rails 3.0.9.

它在开发环境中工作的伟大。时间已经到了把它挂到临时服务器,所以我们可以运行一些全验收测试 - 但是哦,不!我们现在要可怕的内部服务器错误的网页向我们送达回一半的时候,看似随意。我们使用Ruby 1.9.2(P290)的Apache(2)乘客(3.0.9)。

It's working great in the development environment. The time has come to put it up onto the staging server so we can run some full acceptance tests -- but oh, no! We're getting the horrible "Internal Server Error" pages served back at us half of the time, seemingly randomly. We're using Ruby 1.9.2 (p290) Apache (2) and Passenger (3.0.9).

绝对没有被写入到我们的应用程序的日志文件时,这些发生(即使在最低日志级别)。

Absolutely nothing is being written to our app's log file when these happen (even at the lowest log level).

被写入Apache日志的唯一一件事是:

The only thing being written to the Apache log is the following:

[Fri Dec 02 14:36:15 2011] [error] [client <my ip>] Premature end of script headers: <requested path>, referer: <http://domain.com/referrer>

显然,这是太普通,我问修复它!一个错误,但在那里我可以开始寻找调试发生了什么事情会大大AP preciated一些建议。这是推动我疯了。

Obviously this is far too generic an error for me to ask "fix it!", but some advice on where I can start looking to debug what's going on would be greatly appreciated. This is driving me nuts.

更新:此问题的不会发生的禁用链轮(即 config.assets.enabled = FALSE 没关系,它仍然没有...

UPDATE: This problem does not occur with Sprockets disabled (i.e. config.assets.enabled = false) Never mind, it still does...

推荐答案

我发现是什么导致它。

看来这是Rack中间件的一个问题。沿着某处链打破东西宝石(在我的情况下,它是空中刹车(原名黾)的宝石,这也许可以解释为什么在任何地方被记录也不例外)。拆除错误的宝石或将其更新到最新版本(从git的安装,而不是规范RubyGems的源)固定它适合我。

It seems this is a problem with Rack middleware. A gem somewhere along the chain was breaking stuff (in my case it was the Airbrake (formerly known as Hoptoad) gem, which may explain why no exception was being logged anywhere). Removing the errant gem or updating it to the latest version (installing from git rather than the canonical rubygems source) fixed it for me.

如果别人绊倒在这个问题上,我建议您检查堆栈的一部分。

If anyone else stumbles upon this issue, I'd advise you to check that part of your stack.

这篇关于间歇&QUOT;脚本头和QUOT的premature结束;用Rails 3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆