This project is archived and is in readonly mode.

#1239 ✓committed
Luca Guidi

Rails.cache.write returns false with MemCacheStore

Reported by Luca Guidi | October 20th, 2008 @ 05:51 PM | in 2.x

Rails.cache.write returns false with MemCacheStore even if the operation has was successful done.


result = Rails.cache.write('key', 'value')
Rails.cache.read('key') # => value
puts result # => false

The problem is trivial: MemCache#set doesn't return any result, so the check performed by MemCacheStore#write will always fail. http://github.com/rails/rails/tr...

The described behavior is related to memcache-client (1.5.0). I noticed differences between the gem installed on my machine and the bundled one:

memcached-client (1.5.0) gem

http://pastie.org/296380

memcached-client bundled

http://github.com/rails/rails/tr...

I wrote and attached a patch to force using bundled gem to solve this issue.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages