Ruby version: jruby-1.6.8
Rails version 3.2.6
Server: trinidad
每当在未缓存的地方提供资产(图像、CSS 或 JS)时,我在生产模式下的日志中出现错误(即,当它在浏览器缓存中时,应用程序正在发送 304 并且错误没有发生) .
当我在 WEBrick 而不是 Trinidad 下运行应用程序时,它不会发生。
当我设置时,在开发模式下也会发生错误:
config.action_controller.perform_caching = true
日志中出现的错误如下:
Started GET "/assets/pokervane_128-ade771fc66f43a240b500e874c6de23b.png" for 127.0.0.1 at Fri Sep 28 08:41:19 -0400 2012
2012-09-28 08:41:19 -0400 INFO: Served asset /pokervane_128-ade771fc66f43a240b500e874c6de23b.png - 200 OK (0ms)
2012-09-28 08:41:19 -0400 INFO: cache error: can't dump hash with default proc
org/jruby/RubyMarshal.java:101:in `dump'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/actionpack-3.2.6/lib/action_dispatch/http/rack_cache.rb:25:in `write'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/rack-cache-1.2/lib/rack/cache/metastore.rb:83:in `store'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:267:in `store'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:259:in `fetch'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/railties-3.2.6/lib/rails/engine.rb:479:in `call'
/Users/mark/.rvm/gems/jruby-1.6.8/gems/railties-3.2.6/lib/rails/application.rb:220:in `call'
file:/Users/mark/.rvm/gems/jruby-1.6.8/gems/jruby-rack-1.1.10/lib/jruby-rack-1.1.10.jar!/rack/handler/servlet.rb:22:in `call'
我的应用程序不使用活动记录(我在创建它时使用了 --skip-active-record)。为了排除这个事实是相关的,我制作了我的应用程序的副本,添加回:
require active_record/railtie
到 application.rb,并创建了一个数据库。这并没有摆脱错误。
有没有人建议我可以做些什么来摆脱这个错误(当然,除了关闭缓存)。