3

在本地机器上运行 unicorn 时,我不断收到以下服务器错误:

E, [2012-08-17T10:25:11.961002 #95265] ERROR -- : app error: Content-Length header was 780958, but should be 781014 (Rack::Lint::LintError)
E, [2012-08-17T10:25:11.961578 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/lint.rb:19:in `assert'
E, [2012-08-17T10:25:11.961893 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/lint.rb:501:in `verify_content_length'
E, [2012-08-17T10:25:11.962173 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/lint.rb:525:in `each'
E, [2012-08-17T10:25:11.962806 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/body_proxy.rb:26:in `method_missing'
E, [2012-08-17T10:25:11.963116 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_response.rb:41:in `http_response_write'
E, [2012-08-17T10:25:11.963416 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:539:in `process_client'
E, [2012-08-17T10:25:11.963702 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:606:in `worker_loop'
E, [2012-08-17T10:25:11.963985 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
E, [2012-08-17T10:25:11.964288 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:137:in `start'
E, [2012-08-17T10:25:11.964744 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/bin/unicorn:121:in `<top (required)>'
E, [2012-08-17T10:25:11.965043 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/unicorn:19:in `load'
E, [2012-08-17T10:25:11.965339 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/unicorn:19:in `<main>'
E, [2012-08-17T10:25:11.965624 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
E, [2012-08-17T10:25:11.966223 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

有没有人遇到同样的问题?

4

3 回答 3

0

我在运行 unicorn 和 nginx 的 Rails 3.2 应用程序中也遇到了这个问题。我不认为使用 nginx vs. Apache vs. ??? 会很重要。

这解决了我的问题: Rack::Lint Content-Length header error with unicorn/nginx 好奇这是否也适合你。

于 2012-10-21T02:50:01.857 回答
0

这个宝石 unicorn-rails 解决了这个问题:https ://github.com/samuelkadolph/unicorn-rails 。

于 2013-02-07T04:11:43.057 回答
-1

您的响应和内容长度不同,用于bytesize确定响应的长度,而不是length.

于 2012-08-22T00:31:24.260 回答