arthurnn / memcached

A Ruby interface to the libmemcached C client
Academic Free License v3.0
432 stars 127 forks source link

rails 3.2.1, ruby 1.9.3 & memcached #83

Closed ippa closed 12 years ago

ippa commented 12 years ago

Gemfile: gem 'memcached' production.rb: config.cache_store = :mem_cache_store, Memcached::Rails.new("localhost:11211")

Results in: "Could not find cache store adapter for mem_cache_store (cannot load such file -- memcache)"

Googling around I also tried placing " require 'memcached' " in various strategic places, for example suggested here: http://apidock.com/rails/ActionController/Caching/cache_store%3D/class ... but it doesn't fix the problem.

evan commented 12 years ago

Looks like a Rails bug...it's assuming that memcache-client.gem is available even though you are using memcached.gem. Ideally it wouldn't autoload a specific client.

ippa commented 12 years ago

Since googling on the above errormsg gives this page as first results and that version 1.4.1 still doesn't "fix this" this is the solution from Tom Hughes:

"just put an empty file called memcache.rb in the app's lib directory". You also want "memcache-client" in your Gemfile.

Last update: this doesn't seem to be stable (at least not in my environment). At first it worked but it fails randomly with "ActionView::Template::Error (uninitialized constant ActiveSupport::Cache::MemCacheStore::MemCache):" even though I've done the above.

Cheers!