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,并创建了一个数据库。这并没有摆脱错误。
有没有人建议我可以做些什么来摆脱这个错误(当然除了关闭缓存之外)。