简体   繁体   English

Rails 3.1 资产管道不适合我

[英]Rails 3.1 Asset Pipeline doesn't work for me

I'm upgrading a Rails 2.5 app to Rails 3.1 rc4 and I'm getting tons of these kind of errors in development, related to the asset pipeline:我正在将 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'

Basically here the request for the application.css returns an empty body.基本上这里对 application.css 的请求返回一个空正文。

First I thought it might be a server issue, so I switched to webrick, but that didn't help.首先我认为这可能是服务器问题,所以我切换到 webrick,但这并没有帮助。

Help is much appreciated.非常感谢您的帮助。 ;-) ;-)

Nico尼科

I met the same error.我遇到了同样的错误。 But the cause was that I set cache store to redis but I forgot to start redis server.但原因是我将缓存存储设置为 redis 但我忘记启动 redis 服务器。

Okay, not sure what the problem was, but I got rid of the issue by switching to thin as a webserver.好的,不确定问题出在哪里,但我通过切换到 Thin 作为网络服务器解决了这个问题。 The problem occurred with both webrick and mongrel. webrick 和 mongrel 都出现了问题。

I have the same error, because change the default memcached store to dalli.我有同样的错误,因为将默认的 memcached 存储更改为 dalli。

see https://gist.github.com/1625476https://gist.github.com/1625476

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM