Tuesday, February 4, 2014

Solution to remove Warning "Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true"

While working on Rails 4 application, getting following lines in application log file:

[2014-02-04 20:31:12] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
[2014-02-04 20:31:12] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
[2014-02-04 20:31:12] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
[2014-02-04 20:31:12] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true



Solution:
Taken from "http://stackoverflow.com/questions/9612618/warn-could-not-determine-content-length-of-response-body-set-content-length-of"

This is a problem of Webrick. you can use "Thin" instead.
Add this to Gemfile
gem 'thin'
then rails s will use thin instead of Webrick, and the warn will disappear.

No comments:

Post a Comment