Closed jandjshi closed 14 years ago
I had the same issue, I solved it changing on lib/cash/config.rb, the existing line (l.58): @ttl ||= @options[:ttl] || repository.default_ttl || 1.day for this one:
@ttl ||= @options[:ttl] || (repository.respond_to?(:default_ttl) && repository.default_ttl) || 1.day
That fixed my problem as well. Thank you!
I think this is a problem with the memcache client. However, fix is on the way. http://github.com/ngmoco/cache-money/commit/9c927a4aeb1828f4fef8754710f54b100e84ce91
New gem published.
undefined method `default_ttl' for <MemCache: 1 servers, ns: nil, ro: false>:MemCache
I am using ngmoco-cache-money 0.2.21, with Memcached 1.0, Rails 2.3.5, Passenger 2.2.15. The error occurs on every page where a query is needed. The ttl is specified in the memcached.yml.
I tried 0.2.10 and everything worked fine.
Full trace: /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/local.rb:31:in
send' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/local.rb:31:in
method_missing' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/local.rb:17:inautoload_missing_constants' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/local.rb:30:in
method_missing' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/buffered.rb:102:insend' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/buffered.rb:102:in
method_missing' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/transactional.rb:32:insend' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/transactional.rb:32:in
method_missing' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/config.rb:58:inttl' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/index.rb:10:in
initialize' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/config.rb:66:innew' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/config.rb:66:in
indices' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/config.rb:23:in__send__' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/config.rb:23:in
indices' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/write_through.rb:57:inupdate_caches' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/write_through.rb:45:in
send' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/write_through.rb:45:inunfold' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/write_through.rb:26:in
update_caches' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:insend' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in
evaluate_method' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:incall' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:93:in
run' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:ineach' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in
send' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:inrun' /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in
run_callbacks' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:344:incallback' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:283:in
update' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2874:increate_or_update_without_callbacks' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:250:in
create_or_update' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:insave_without_validation' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in
save_without_dirty' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:insave_without_transactions' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in
send' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:inwith_transaction_returning_status' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cache_money.rb:63:in
transaction' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cash/transactional.rb:13:intransaction' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cache_money.rb:63:in
transaction' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:intransaction' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in
transaction_without_cache_transaction' /opt/ruby/lib/ruby/gems/1.8/gems/ngmoco-cache-money-0.2.21/lib/cache_money.rb:62:intransaction' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in
with_transaction_returning_status' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:insave' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in
rollback_active_record_state!' /opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:insave' /opt/ruby/lib/ruby/gems/1.8/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/session_maintenance.rb:73:in
save_without_session_maintenance' /opt/ruby/lib/ruby/gems/1.8/gems/authlogic-2.1.6/lib/authlogic/session/callbacks.rb:95:insave_record' /opt/ruby/lib/ruby/gems/1.8/gems/authlogic-2.1.6/lib/authlogic/session/priority_record.rb:30:in
save_record' /opt/ruby/lib/ruby/gems/1.8/gems/authlogic-2.1.6/lib/authlogic/session/existence.rb:73:insave' /home/jeff/projects/dating/app/controllers/user_sessions_controller.rb:14:in
create'