Re: Re: Memcache

Yani Yen
Tue, 20 Jul 2010 07:14:22 -0000

Hi,

What i did in my environment.rb file was created an instance of memcache
and assign it to a constant:

CACHE = MemCache.new(''127.0.0.1'')

and then in my code something like this:

def data_cache(key)
  unless output = CACHE.get(key)
    output = yield
    CACHE.set(key, output, 1.hour)
  end
  return output
end

Now the problem is i keep getting the error:
MemCache::MemCacheError (Resource temporarily unavailable - ):
  c:/jruby-1.5.1/lib/ruby/1.8/net/protocol.rb:116:in `readuntil''
  app/controllers/application_controller.rb:102:in `data_cache''
  app/controllers/channel_members_controller.rb:27:in `follows''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:173:in `start_thread''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:162:in `start''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:162:in `start_thread''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:95:in `start''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:92:in `each''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:92:in `start''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:23:in `start''
  c:/jruby-1.5.1/lib/ruby/1.8/webrick/server.rb:82:in `start''


Please help