WEBrickのログがいっぱいでるのは困る

Rails3.1.3+Windowsでたくさん出てくるコイツ

Started GET "/assets/hoge.js?body=1" for 127.0.0.1 at 2012-09-24 09:22:00 +0900
Served asset /hoge.js - 304 Not Modified (0ms)
[2012-09-24 09:22:00] WARN Could not determine content-length of response body. Set content-le
ngth of the response or set Response#chunked = true

困っている人は多いらしくRails Serverのログを抑制する方法を参考にする。

#C:\Ruby193\lib\ruby\1.9.1\webrick
#205行目
# if chunked? || @header['content-length']
if chunked? || @header['content-length'] || @status == 304 || @status == 204

これだけでWARNが消えた

Started GET "/assets/hoge.js?body=1" for 127.0.0.1 at 2012-09-24 09:28:00 +0900
Served asset /hoge.js - 304 Not Modified (0ms)

 
thinを使う方法を推奨しているのでやってみる。

#app_root/Gemfile
gem 'thin' #追記

ターミナルで

kenmituo@HOGE ~/Documents/Aptana Studio 3 Workspace/hoge
$ bundle install
...(中略)
Installing thin (1.5.0) with native extensions

うごいた。

sprocketsの件も試す

#app_root/Gemfile
gem 'rails-clean-logs', :git => 'git://github.com/kyokoshima/rails-clean-logs.git' #追記

エラーになる。
[https://github.com/kyokoshima/rails-clean-logs/blob/master/README.md:title=
rails-clean-logs / README.md]を読むとgitは不要みたいだ。
ターミナルで

kenmituo@HOGE ~/Documents/Aptana Studio 3 Workspace/hoge
$ bundle install
...(中略)
Installing rails-clean-logs (1.0)

そして起動すると

$rails s thin
c:/Ruby193/lib/ruby/1.9.1/logger.rb:599:in `initialize': No such file or directory - /dev/null
(Errno::ENOENT)

しまった。

ターミナル

$ gem uninstall rails-clean-logs
Successfully uninstalled rails-clean-logs-1.0


ターミナルで直接指定しても入らない。文法が悪いのかな、、、
ローカルで何とかしたい

まとめ

  • app_root/Gemfileに追記
gem 'thin'
gem 'rails-clean-logs'
  • ターミナル

$ bundle install