nkallen / cache-money

A Write-Through Cacheing Library for ActiveRecord
Apache License 2.0
994 stars 107 forks source link

repository delegated to @cache_config.repository, but @cache_config is nil #11

Open ponny opened 14 years ago

ponny commented 14 years ago

I've tried getting backgroundrb and background-fu going. Cache money seems to be getting in the way somehow - /var/lib/gems/1.8/gems/nkallen-cache-money-0.2.5/lib/cash/config.rb:18:in `repository': repository delegated to @cache_config.repository, but @cache_config is nil: BdrbJobQueue(id: integer, args: binary, worker_name: string, worker_method: string, job_key: string, taken: integer, finished: integer, timeout: integer, priority: integer, submitted_at: datetime, started_at: datetime, finished_at: datetime, archived_at: datetime, tag: string, submitter_info: string, runner_info: string, worker_key: string, scheduled_at: datetime) (RuntimeError)

It did the same thing for background-fu's Job model too. I have absolutely no idea what is wrong with it.

benone commented 14 years ago

I have the same issue with acts_as_taggable gem

gsmendoza commented 14 years ago

I have the same issue when using delayed job.

benone commented 14 years ago

I found a solution for this issue.

The thing is cache-money config file is loading after acts_as_taggable gem. So I placed "require File.join(RAILS_ROOT, "config", "initializers","cache_money.rb")" to begin of acts_as_taggable main file (lib/acts-as-taggable-on.rb) and it works!

krishnasrihari commented 14 years ago

I have same problem and solved because I am using active_record session store. Now I changed to memcached store as config.action_controller.session_store = :mem_cache_store in environment.rb file and working fine now.

huacnlee commented 14 years ago

@benone I was modified like you, but the other issue "stack level too deep" appeared

huacnlee commented 14 years ago

I was solution too. same as @benone's way, but you need use CacheMoney with plugins, not Gem

smtlaissezfaire commented 14 years ago

Yeah - it's a preloading issue - fixed in this branch:

http://github.com/smtlaissezfaire/cache-money/tree/preloading_error