What might cause this error? TypeError (singleton can''t be dumped): /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' /usr/lib/ruby/1.8/pstore.rb:138:in `transaction'' /usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update'' /usr/lib/ruby/1.8/cgi/session/pstore.rb:97:in `close'' /usr/lib/ruby/1.8/cgi/session.rb:330:in `close'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/base.rb:914:in `close_session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/base.rb:372:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/session_management.rb:116:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 117:in `handle_dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 83:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 69:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/ webrick.rb:59 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ active_support/dependencies.rb:214:in `require'' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ active_support/dependencies.rb:214:in `require'' ./script/server:3
Something in the session can''t be serialized? b Peter Brown wrote:> What might cause this error? > > TypeError (singleton can''t be dumped): > /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' > /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' > /usr/lib/ruby/1.8/pstore.rb:138:in `transaction'' > /usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update'' > /usr/lib/ruby/1.8/cgi/session/pstore.rb:97:in `close'' > /usr/lib/ruby/1.8/cgi/session.rb:330:in `close'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ > action_controller/base.rb:914:in `close_session'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ > action_controller/base.rb:372:in > `process_without_session_management_support'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ > action_controller/session_management.rb:116:in `process'' > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in > `dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: > 117:in `handle_dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 83:in > `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 69:in > `dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/ > webrick.rb:59 > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require__'' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ > active_support/dependencies.rb:214:in `require'' > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28 > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require__'' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ > active_support/dependencies.rb:214:in `require'' > ./script/server:3 > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Don''t store into session objects that have singlton methods: $ irb irb(main):001:0> o = Object.new => #<Object:0x356838> irb(main):002:0> def o.test; puts ''test'' end => nil irb(main):003:0> Marshal.d Marshal.display Marshal.dup Marshal.dump irb(main):003:0> Marshal.dump(o) TypeError: singleton can''t be dumped from (irb):3:in `dump'' from (irb):3:in `binding'' from :0 irb(main):004:0> Kent. On 2/13/06, Ben Munat <bent@munat.com> wrote:> Something in the session can''t be serialized? > > b > > Peter Brown wrote: > > What might cause this error? > > > > TypeError (singleton can''t be dumped): > > /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' > > /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' > > /usr/lib/ruby/1.8/pstore.rb:138:in `transaction'' > > /usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update'' > > /usr/lib/ruby/1.8/cgi/session/pstore.rb:97:in `close'' > > /usr/lib/ruby/1.8/cgi/session.rb:330:in `close'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ > > action_controller/base.rb:914:in `close_session'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ > > action_controller/base.rb:372:in > > `process_without_session_management_support'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ > > action_controller/session_management.rb:116:in `process'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in > > `dispatch'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: > > 117:in `handle_dispatch'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 83:in > > `service'' > > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > > /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' > > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 69:in > > `dispatch'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/ > > webrick.rb:59 > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require__'' > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ > > active_support/dependencies.rb:214:in `require'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28 > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require__'' > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ > > active_support/dependencies.rb:214:in `require'' > > ./script/server:3 > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Wow, that''s weird... why''s that? I knew threads and resources could be serialized, but anything with a singleton method? Oh wait, I guess that makes sense because once you''ve added a the method to the instance it no longer meets the class definition. Right? b Kent Sibilev wrote:> Don''t store into session objects that have singlton methods: > > $ irb > irb(main):001:0> o = Object.new > => #<Object:0x356838> > irb(main):002:0> def o.test; puts ''test'' end > => nil > irb(main):003:0> Marshal.d > Marshal.display Marshal.dup Marshal.dump > irb(main):003:0> Marshal.dump(o) > TypeError: singleton can''t be dumped > from (irb):3:in `dump'' > from (irb):3:in `binding'' > from :0 > irb(main):004:0> > > Kent. > > On 2/13/06, Ben Munat <bent@munat.com> wrote: > >>Something in the session can''t be serialized? >> >>b >> >>Peter Brown wrote: >> >>>What might cause this error? >>> >>>TypeError (singleton can''t be dumped): >>> /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' >>> /usr/lib/ruby/1.8/pstore.rb:159:in `dump'' >>> /usr/lib/ruby/1.8/pstore.rb:138:in `transaction'' >>> /usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update'' >>> /usr/lib/ruby/1.8/cgi/session/pstore.rb:97:in `close'' >>> /usr/lib/ruby/1.8/cgi/session.rb:330:in `close'' >>> /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ >>>action_controller/base.rb:914:in `close_session'' >>> /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ >>>action_controller/base.rb:372:in >>>`process_without_session_management_support'' >>> /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ >>>action_controller/session_management.rb:116:in `process'' >>> /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in >>>`dispatch'' >>> /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: >>>117:in `handle_dispatch'' >>> /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 83:in >>>`service'' >>> /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' >>> /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' >>> /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' >>> /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' >>> /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' >>> /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' >>> /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' >>> /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' >>> /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' >>> /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' >>> /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb: 69:in >>>`dispatch'' >>> /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/ >>>webrick.rb:59 >>> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in >>>`require__'' >>> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' >>> /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ >>>active_support/dependencies.rb:214:in `require'' >>> /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28 >>> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in >>>`require__'' >>> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' >>> /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ >>>active_support/dependencies.rb:214:in `require'' >>> ./script/server:3 >>> >>> >>>_______________________________________________ >>>Rails mailing list >>>Rails@lists.rubyonrails.org >>>http://lists.rubyonrails.org/mailman/listinfo/rails >> >>_______________________________________________ >>Rails mailing list >>Rails@lists.rubyonrails.org >>http://lists.rubyonrails.org/mailman/listinfo/rails >> > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails