Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save railsfactory-kumaresan/96c7cffa4bc1d2020bd84929a4f94417 to your computer and use it in GitHub Desktop.
Save railsfactory-kumaresan/96c7cffa4bc1d2020bd84929a4f94417 to your computer and use it in GitHub Desktop.
You are trying to cache a Ruby object which cannot be serialized to memcached.
Marshalling error for key '_my_session:1243f4a7a0c8d1dba363bc2ca7a246e8': singleton can't be dumped
You are trying to cache a Ruby object which cannot be serialized to memcached.
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/dalli-2.7.0/lib/dalli/server.rb:398:in `dump'
#Controller problem
session[:telefones] = Cliente.telefones
#Solution
session[:telefones] = Cliente.telefones.entries
# Monthpack: Global Solution
module Dalli
class Server
def serialize_with_modification(key, value, options=nil)
serialize_without_modification(key, value.entries, options=nil)
end
alias_method_chain :serialize, :modification
end
end
# Read the post: http://testandocomtesta.blogspot.com.br/2014/02/rails3-ruby19-dalli-memcache-client.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment