Hi everyone,
We’re setting up memcached with Rails 2.1 and we’re hitting an error
with some classes. For instance:
Rails.cache.fetch(‘all_categories’) {Category.all}
ArgumentError: undefined class/module Category
from
/opt/ruby-ee/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb:241:in
load' from /opt/ruby-ee/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb:241:in
get’
from
/opt/ruby-ee/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/cache/mem_cache_store.rb:26:in
read' from /opt/ruby-ee/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/cache.rb:55:in
fetch’
from (irb):1
If I drop into the debugger, the error comes up on line 214 in
memcache.rb:
value = Marshal.load value unless raw
When it’s loading the data, it can’t figure out what Category is.
It’s a normal model. Why isn’t it loaded at this point in the app?
Thanks,
Sean