Forum: Ruby on Rails no marshal_dump is defined for class Proc

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D90ef6808433e63203e15a5c2dadb0bb?d=identicon&s=25 Ben Reubenstein (Guest)
on 2006-04-04 00:01
(Received via mailing list)
Hello ~

This problem has me puzzled.  When users login to my rails app I have
the
session set up to be stored in the MySQL database for the app.
Intermittently, users will get the following error:

no marshal_dump is defined for class Proc
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session/active_record_store.rb:81:in
`dump'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session/active_record_store.rb:81:in
`marshal'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session/active_record_store.rb:133:in
`marshal_data!'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/callbacks.rb:333:in
`callback'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/callbacks.rb:330:in
`callback'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/callbacks.rb:248:in
`create_or_update'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1388:in
`save_without_validation'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/validations.rb:724:in
`save_without_transactions'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/transactions.rb:126:in
`save'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/connection_adapters/abstract/database_statements.rb:51:in
`transaction'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/transactions.rb:91:in
`transaction'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/transactions.rb:118:in
`transaction'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/transactions.rb:126:in
`save'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session/active_record_store.rb:307:in
`update'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:794:in
`silence'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session/active_record_store.rb:307:in
`update'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session/active_record_store.rb:314:in
`close'
D:/apps/xampp/ruby/lib/ruby/1.8/cgi/session.rb:330:in `close'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:982:in
`close_session'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:1024:in
`process_cleanup_without_flash'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/flash.rb:147:in
`process_cleanup_without_filters'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:426:in
`process_cleanup_without_session_management_support'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:126:in
`process_cleanup_without_components'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/components.rb:182:in
`process_cleanup'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:383:in
`process_without_filters'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:364:in
`process_without_session_management_support'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:117:in
`process'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/dispatcher.rb:38:in
`dispatch'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:150:in
`process_request'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:54:in
`process!'
D:/apps/xampp/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:598:in `each_cgi'
D:/apps/xampp/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each_cgi'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:53:in
`process!'
D:/apps/xampp/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/fcgi_handler.rb:23:in
`process!'
D:/Data/web/remw/advocate/public/dispatch.fcgi:24

I have had this happen in Windows running in development mode and on
Linux
running in production.  Any ideas or potential pointers would be greatly
appreciated.

Thx,

Ben
6076c22b65b36f5d75c30bdcfb2fda85?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-04-04 00:35
(Received via mailing list)
Ben-

	You cannot marshal objects that have procs or lambdas in them. Its a
current limitation of the ruby interpreter. What exactly are you
storing in the session? Whole objects? Or just id's? SHow me what you
are storing in the session and I can help you figure it out.

CHeers-
-Ezra
D90ef6808433e63203e15a5c2dadb0bb?d=identicon&s=25 Ben Reubenstein (Guest)
on 2006-04-07 19:55
(Received via mailing list)
Hi Ezra ~

Thx for the tip.  I was storing an entire object, but after much
consideration decided it was overkill and a potential security risk to
store
the object in the session.  I adjusted my app to only store some key
elements in the session, and voila!

Thx again,

Ben
This topic is locked and can not be replied to.