Sent too soon. Wanted to add that if I run the cache call and watch
it fail (and it''ll fail over and over again), then just call:
Category
And then run the call again, it works.
Also, there are other models where this seems to work ok. I can''t
find the difference except that perhaps those models are being called
somewhere in the stack before the cache call is made.
Thanks,
Sean
On Wed, Sep 24, 2008 at 5:02 PM, Sean Hussey
<seanhussey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---