ActiveSupport uninitialized constant :: Cache :: MemCacheStore :: MemCache

I got this error when I started my project with memcache (gem) and rails 3.0.0beta p>

Here's the full trace:

/Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:39:in `build_mem_cache': uninitialized constant ActiveSupport::Cache::MemCacheStore::MemCache (NameError) from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:65:in `initialize' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `new' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `lookup_store' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47 from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:22:in `with_warnings' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47 from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `instance_exec' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `run' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:55:in `run_initializers' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `each' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `run_initializers' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:119:in `initialize!' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `send' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `method_missing' from /Users/netbe/Projects/banana/config/environment.rb:5 from config.ru:3:in `require' from config.ru:3 from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' from config.ru:1:in `new' from config.ru:1 

Here is some code from my .rb environment, line # 5: Cache module

 require 'active_support/cache' module ActiveSupport module Cache class MemCacheStore < Store def logger Rails.logger end end end end 

Is there anyone who can guess what is wrong here, is this a problem with rails 3?

+4
source share
2 answers

in fact, you did not add the gem "memcache-client" to your Gemfile, apparently you only have a "memcache" gem

+6
source

I think my answer is too late :) But maybe this helps someone. I have the same error and the problem was in the file name in the lib / memcache.rb directory. After renaming it, the project started as usual.

0
source

Source: https://habr.com/ru/post/1314833/


All Articles