# Memcache-client config problem

**URL:** <https://www.ruby-forum.com/t/memcache-client-config-problem/109387>\
**Category:** Rails\
**Created:** [July 13, 2007, 11:17pm UTC](https://www.ruby-forum.com/t/memcache-client-config-problem/109387 "2007-07-13T23:17:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@krates](https://www.ruby-forum.com/u/krates)\
**Post date:** [July 13, 2007, 11:17pm UTC](https://www.ruby-forum.com/t/memcache-client-config-problem/109387/1 "2007-07-13T23:17:44Z")

</div>

I am trying to use memcache-client to store session. I have found great  
instructions online. However, I keep getting error and fail to start  
rails on radrails.

I have “gem install memcache-client”:

# ============ gem list =============== memcache-client (1.3.0) A Ruby memcached client

I’ve configured with the following:

# =========== environment.rb =============== require\_gem ‘memcache-client’ Rails::Initializer.run do |config| config.action\_controller.session\_store =:mem\_cache\_store end memcache\_options = { :compression =\> true, :debug =\> false, :namespace =\> “pr-#{RAILS\_ENV}”, :readonly =\> false, :urlencode =\> false } memcache\_servers = [‘127.0.0.1:11211’] CACHE = MemCache.new(memcache\_options) CACHE.servers = memcache\_servers ActionController::Base.session\_options[:cache] = CACHE

I keep getting either of these errors (depending on whichever one comes  
first in environment.rb:

=========== errors ===============  
uninitialized constant CGI::Session::MemCacheStore (NameError)

# uninitialized constant MemCache (NameError)

memcache-client appears to have loaded properly with require\_gem. I  
tried changing the config many times, but keep getting these errors.  
Any help would be greatly appreciated.

thanks a lot!  
-Krates

---

<div class="post-metadata">

**Author:** ![krates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@krates](https://www.ruby-forum.com/u/krates)\
**Post date:** [March 26, 2008, 1:03am UTC](https://www.ruby-forum.com/t/memcache-client-config-problem/109387/2 "2008-03-26T01:03:50Z")

</div>

This is due to not having at least “hoe” and maybe “rubyforge” gems not  
also updated.

Just do a global update if you don’t have any others, but otherwise just  
try going into irb and directly including the memcache-client lib.

# irb

> require ‘rubygems’  
> gem ‘memcache-client’

You should get an error here about what’s missing.

Nathaniel.

Krates Ng wrote:

> I am trying to use memcache-client to store session. I have found great  
> instructions online. However, I keep getting error and fail to start  
> rails on radrails.
> 
> I have “gem install memcache-client”:
> 
> # ============ gem list =============== memcache-client (1.3.0) A Ruby memcached client
> 
> I’ve configured with the following:
> 
> # =========== environment.rb =============== require\_gem ‘memcache-client’ Rails::Initializer.run do |config| config.action\_controller.session\_store =:mem\_cache\_store end memcache\_options = { :compression =\> true, :debug =\> false, :namespace =\> “pr-#{RAILS\_ENV}”, :readonly =\> false, :urlencode =\> false } memcache\_servers = [‘127.0.0.1:11211’] CACHE = MemCache.new(memcache\_options) CACHE.servers = memcache\_servers ActionController::Base.session\_options[:cache] = CACHE
> 
> I keep getting either of these errors (depending on whichever one comes  
> first in environment.rb:
> 
> =========== errors ===============  
> uninitialized constant CGI::Session::MemCacheStore (NameError)
> 
> # uninitialized constant MemCache (NameError)
> 
> memcache-client appears to have loaded properly with require\_gem. I  
> tried changing the config many times, but keep getting these errors.  
> Any help would be greatly appreciated.
> 
> thanks a lot!  
> -Krates

---

<div class="post-metadata">

**Author:** ![krates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@krates](https://www.ruby-forum.com/u/krates)\
**Post date:** [January 4, 2009, 10:31pm UTC](https://www.ruby-forum.com/t/memcache-client-config-problem/109387/3 "2009-01-04T22:31:30Z")

</div>

very helpful…  
thanks!

On Mar 26 2008, 2:03 am, Nathaniel B. \<rails-mailing-l…@andreas-
