What does "WARN Could not determine content-length of response body." mean and how to I get rid of it?

Asked the same question to one of Rails-Core's members:

https://twitter.com/luislavena/status/108998968859566080

And the answer:

https://twitter.com/tenderlove/status/108999110136303617

ya, it's fine. Need to clean it up, but nothing is being hurt.


The following patch solved the problem in my case; no more warnings for me.

204_304_keep_alive.patch

Just edit the file httpresponse.rb at line 205 as shown at the link above; in fact the link shows a correction made to a future release of Ruby.

I'm using rails 3.2.0 on ruby 1.9.3-p0 installed through RVM as a single user. So the location in my case is:

~/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpresponse.rb

The location of the file to be altered differs depending on the type of installation, RVM or not, or even multi-user or single user, so I'm just giving the last part of it:

.../ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpresponse.rb

I hope this can be helpful to someone.

EDIT: This is the link to the commit that altered the line in question in the trunk branch of ruby project.


Just explicitly adding the Gem to the Gemfile got rid of the warning messages for me:

group :development do
  gem 'webrick', '~> 1.3.1'
end