I''m at the bloody forehead stage, so I figure it''s time to ask. After installing the robot coop''s memcache-client which everyone apparently recommends, it refuses to work because the rails cache.rb is invoking the read() method on the cache, which it _does not have_. Their library has get() and put() but no read() and write() as rails expects. What gives? Is everyone quietly writing wrapper libraries around this? No mention on any blogs...help would be greatly appreciated My setup from environment.rb initialize: CACHE = MemCache.new :c_threshold => 10_000,:compression => true,:debug => false,:namespace => ''foo'',:readonly => false,:urlencode => false CACHE.servers = ''localhost:11211'' config.action_controller.session_store = :mem_cache_store config.action_controller.fragment_cache_store = CACHE, {} Incidentally, the session store works with memcache-client, but the fragment cache craps out. I''ve tried every method on every blog entry out there that I could find, but they are inconsistent with the rails source code, or I am missing something. Thanks! -- Posted via http://www.ruby-forum.com/.
yan wrote:> I''m at the bloody forehead stage, so I figure it''s time to ask. After > installing the robot coop''s memcache-client which everyone apparently > recommends, it refuses to work because the rails cache.rb is invoking > the read() method on the cache, which it _does not have_. Their library > has get() and put() but no read() and write() as rails expects. What > gives? Is everyone quietly writing wrapper libraries around this? No > mention on any blogs...help would be greatly appreciated > > My setup from environment.rb initialize: > > CACHE = MemCache.new :c_threshold => 10_000,:compression => > true,:debug => false,:namespace => ''foo'',:readonly => false,:urlencode > => false > CACHE.servers = ''localhost:11211'' > > config.action_controller.session_store = :mem_cache_store > config.action_controller.fragment_cache_store = CACHE, {} > > Incidentally, the session store works with memcache-client, but the > fragment cache craps out. I''ve tried every method on every blog entry > out there that I could find, but they are inconsistent with the rails > source code, or I am missing something. Thanks! > >I vaguely recall reading about some funniness with that client. try asking on the memcached list at memcached@lists.danga.com
On 8/18/06, yan <yan@pritzker.ws> wrote:> > I''m at the bloody forehead stage, so I figure it''s time to ask. After > installing the robot coop''s memcache-client which everyone apparently > recommends, it refuses to work because the rails cache.rb is invoking > the read() method on the cache, which it _does not have_. Their library > has get() and put() but no read() and write() as rails expects. What > gives? Is everyone quietly writing wrapper libraries around this? No > mention on any blogs...help would be greatly appreciated > > My setup from environment.rb initialize: > > CACHE = MemCache.new :c_threshold => 10_000,:compression => > true,:debug => false,:namespace => ''foo'',:readonly => false,:urlencode > => false > CACHE.servers = ''localhost:11211'' > > config.action_controller.session_store = :mem_cache_store > config.action_controller.fragment_cache_store = CACHE, {} > > Incidentally, the session store works with memcache-client, but the > fragment cache craps out. I''ve tried every method on every blog entry > out there that I could find, but they are inconsistent with the rails > source code, or I am missing something. Thanks! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Yan I got memcache-client working with memcached-1.1.13-pre-win32 on Windows 2000 machine. My environment.rb look like this memcache_options = { :compression => false, :debug => false, :namespace => "app-#{RAILS_ENV}", :readonly => false, :urlencode => false } memcache_servers = ["localhost:11211"] Rails::Initializer.run do |config| . . config.action_controller.session_store = :mem_cache_store config.action_controller.fragment_cache_store = :mem_cache_store, memcache_options . . end CACHE = MemCache.new(memcache_options) CACHE.servers = memcache_servers ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.merge!({ ''cache'' => CACHE }) then I start my memcached like this memcached.exe -vv -p 11211 hope this helps. -daya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060907/e35f737d/attachment.html
On 8/18/06, yan <yan@pritzker.ws> wrote:> > I''m at the bloody forehead stage, so I figure it''s time to ask. After > installing the robot coop''s memcache-client which everyone apparently > recommends, it refuses to work because the rails cache.rb is invoking > the read() method on the cache, which it _does not have_. Their library > has get() and put() but no read() and write() as rails expects. What > gives? Is everyone quietly writing wrapper libraries around this? No > mention on any blogs...help would be greatly appreciated > > My setup from environment.rb initialize: > > CACHE = MemCache.new :c_threshold => 10_000,:compression => > true,:debug => false,:namespace => ''foo'',:readonly => false,:urlencode > => false > CACHE.servers = ''localhost:11211'' > > config.action_controller.session_store = :mem_cache_store > config.action_controller.fragment_cache_store = CACHE, {} > > Incidentally, the session store works with memcache-client, but the > fragment cache craps out. I''ve tried every method on every blog entry > out there that I could find, but they are inconsistent with the rails > source code, or I am missing something. Thanks! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsYan I don''t have a solution for your problem since I am also looking to use MemCache. I was wondering what kind of session store are you using with MemCache which is working for you? TIA -daya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060823/aa98a411/attachment-0001.html