Memcache_client fails Marshal.load of AR objects

wondering if anyone watching can make sense of this,

I’m try to work the memcache_client into my app, but every time it tries
to read from memcache I get a Marshall error that the AR classes are not
defined. But it’s more vexing than that, as the error does not occur
within the console. From a console everything works as expected, but
when running in the app it fails.

Here is the backtrace…

Memcacher Exception Caught:

undefined class/module ModuleCategory

Exception Message:

undefined class/module ModuleCategory

Stack Trace:

./script/…/config/…/vendor/gems/memcache-client-1.5.0/lib/memcache.rb:214:in
load' ./script/../config/../vendor/gems/memcache-client-1.5.0/lib/memcache.rb:214:inget’
/home/andy/stringsDB/external/lib/memcacher.rb:21:in memcache_me' /home/andy/stringsDB/external/app/controllers/strings_controller.rb:11:inindex’
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/base.rb:1101:in
send' /home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/base.rb:1101:inperform_action_without_filters’
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/filters.rb:696:in
call_filters' /home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/filters.rb:688:inperform_action_without_benchmark’
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:inperform_action_without_caching’
/home/andy/stringsDB/external/vendor/plugins/query_cache/lib/query_cache.rb:133:in
perform_action' /home/andy/stringsDB/external/vendor/plugins/query_cache/lib/query_cache.rb:106:incache’
/home/andy/stringsDB/external/vendor/plugins/query_cache/lib/query_cache.rb:132:in
perform_action' /home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/base.rb:435:insend’
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/base.rb:435:in
process_without_filters' /home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/filters.rb:684:inprocess_without_session_management_support’
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
sass_old_process' /home/andy/stringsDB/external/vendor/plugins/haml_sass/lib/sass/plugin.rb:124:inprocess’
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/base.rb:334:in
process' /home/andy/stringsDB/external/vendor/rails/railties/lib/dispatcher.rb:41:indispatch’
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/rails.rb:76:in
process' /var/lib/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:insynchronize’
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/rails.rb:74:in
process' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:inprocess_client’
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in each' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:inprocess_client’
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in run' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:ininitialize’
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in new' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:inrun’
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in initialize' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:innew’
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in run' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:inrun’
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in
each' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:inrun’
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in run' /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:inrun’
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/home/andy/stringsDB/external/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in
load' /home/andy/stringsDB/external/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:inload’
/home/andy/stringsDB/external/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' /home/andy/stringsDB/external/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:inload’
/home/andy/stringsDB/external/vendor/rails/railties/lib/commands/servers/mongrel.rb:60
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/home/andy/stringsDB/external/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
require' /home/andy/stringsDB/external/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
/home/andy/stringsDB/external/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
require' /home/andy/stringsDB/external/vendor/rails/railties/lib/commands/server.rb:39 script/server:3:inrequire’
script/server:3

Andy K. wrote:

./script/…/config/…/vendor/gems/memcache-client-1.5.0/lib/memcache.rb:214:in
/home/andy/stringsDB/external/vendor/rails/actionpack/lib/action_controller/filters.rb:696:in
/home/andy/stringsDB/external/vendor/plugins/query_cache/lib/query_cache.rb:133:in
process_without_session_management_support' /var/lib/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:in /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:ininitialize’
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
`gem_original_require’

Found this solution by Wes G. (thanks Wes) that seems to work…
http://www.ruby-forum.com/topic/100121#215541

But I have to say, it seems antithetical in a Rails app. I don’t
necessarily think this is a memcache_client issue. I have another app
that uses memcache_client and I’ve not had any issue like this - very
curious.