我正在将 Rails 2.5 应用程序升级到 Rails 3.1 rc4,并且在开发过程中遇到了大量与资产管道相关的错误:
cache: [GET /assets/application-272985f6b5b17a3aeb1b84a6a376e225.css] miss, store
2011-07-06 16:03:56 +0300: Read error: #<NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each>
gems/ruby-1.9.2-p0/gems/rack-1.3.0/lib/rack/handler/mongrel.rb:90:in `process'
gems/ruby-1.9.2-p0/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:165:in `block in process_client'
gems/ruby-1.9.2-p0/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:164:in `each'
gems/ruby-1.9.2-p0/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:164:in `process_client'
gems/ruby-1.9.2-p0/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:291:in `block (2 levels) in run'
基本上这里对 application.css 的请求返回一个空的正文。
首先我认为这可能是服务器问题,所以我切换到 webrick,但这并没有帮助。
非常感谢您的帮助。;-)
尼科