undefined local variable or method `second_level_cache'
jdejong opened this issue · 3 comments
I am getting the following error when trying to include second_level_cache in a project I am working on:
dynamic_matchers.rb:26:in method_missing': undefined local variable or method
second_level_cache' for #Class:0x007fb01ff2d150 (NameError)
Using
second_level_cache (2.1.14)
activerecord (> 4.0.0, < 5.0)
activesupport (> 4.0.0, < 5.0)
rails (4.2.8)
actionmailer (= 4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
activemodel (= 4.2.8)
activerecord (= 4.2.8)
activesupport (= 4.2.8)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.8)
sprockets-rails
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin16]
Any idea's why the GEM is not auto loading the class? I tried adding a require for second_level_cache and even tried including the concern into a class and nothing seemed to help.
Thanks
Use second_level_cache 2.3
2.3 is AR 5 only, I am on AR 4 (rails 4.2) so that will not work. Or is something broken in the Rails 4 version?
See document on Tag 2.1.x
https://github.com/hooopo/second_level_cache/tree/v2.1.9
API has changed after 2.2 from acts_as_cached
to second_level_cache