gpt4 book ai didi

ruby-on-rails - 警告无法确定响应正文的内容长度。设置响应的内容长度或设置 Response#chunked = true

转载 作者:行者123 更新时间:2023-12-03 04:36:29 25 4
gpt4 key购买 nike

Possible Duplicate:
What does “WARN Could not determine content-length of response body.” mean and how to I get rid of it?

我刚刚升级到rails 3.2.2,现在在rails s上,页面加载,我在日志中收到所有这些错误:

[2012-03-07 19:46:14] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
[2012-03-07 19:46:14] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

根据之前的 SO 线程,我尝试了以下操作:

/config/application.rb

config.assets.logger = false
config.assets.logger = nil

这些都不起作用。关于如何禁用此错误的日志记录有什么想法吗?或者解决问题:)

谢谢

最佳答案

这是Webrick的问题。您可以使用“Thin”代替。

将其添加到 Gemfile

gem 'thin'

然后rails s将使用thin而不是Webrick,并且警告将会消失。

关于ruby-on-rails - 警告无法确定响应正文的内容长度。设置响应的内容长度或设置 Response#chunked = true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9612618/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com