Hi I''m trying to delete the a directory and all the directories/images below it. The images and directories get deleted, and then it gets redirected as you''d expect, but then rails crashes, big time. Really have no idea why it is dying and the logs which are usually very helpful mean nothing to me. Any idea what the problem is? below is the relevent code and the associated logs. Thank you in advance for any light you can shine on this... def delete_image @vobject = session[:vobject] if @vobject if params[:image] == "primary_image" if @vobject.primary_image.blank? #error redirect to error redirect_to :action => :error_page else logger.info("@vobject.primary_image + " + @vobject.primary_image) FileUtils.remove_dir(File.dirname(@vobject.primary_image),false) @vobject.primary_image = nil # logger.info("@vobject.primary_image2 + " + @vobject.primary_image) redirect_to :action => :preview end end end end Processing UserController#delete_image (for 192.168.2.5 at 2006-09-16 11:57:17) [POST] Session ID: d846c387da03b9b83ed3f63fdea821e6 Parameters: {"action"=>"delete_image", "id"=>"65873", "controller"=>"user", "image"=>"primary_image"} Subscriber Load (0.003144) SELECT * FROM subscribers WHERE (subscribers.`id` = 1 ) LIMIT 1 Subscriber Load (0.003084) SELECT * FROM subscribers WHERE (subscribers.`id` = 1 ) LIMIT 1 @vobject.primary_image + /home/casparbl/user/V_O_2/public/../config/../public/vo_object/primary_image/65873/Blue_hills.jpg Redirected to http://192.168.2.2:3000/user/preview Completed in 0.01984 (50 reqs/sec) | DB: 0.02220 (111%) | 302 Found [http://192.168.2.2/user/delete_image/65873?image=primary_image] Processing Base#delete_image (for 192.168.2.5 at 2006-09-16 11:57:17) [POST] Session ID: d846c387da03b9b83ed3f63fdea821e6 Parameters: {"action"=>"delete_image", "id"=>"65873", "controller"=>"user", "image"=>"primary_image"} TypeError (no marshal_dump is defined for class Proc): /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' /usr/lib/ruby/1.8/pstore.rb:326: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.12.5/lib/action_controller/base.rb:1015:in `close_session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:1057:in `process_cleanup_without_flash'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/flash.rb:147:in `process_cleanup_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:439:in `process_cleanup_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:126:in `process_cleanup_without_components'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/components.rb:182:in `process_cleanup'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:412:in `process_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!'' /usr/lib/ruby/1.8/fcgi.rb:600:in `each_cgi'' /usr/lib/ruby/1.8/fcgi.rb:597:in `each_cgi'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!'' /home/casparbl/user/V_O_2/public/dispatch.fcgi:24 Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/templates/rescues/layout.rhtml (500 Internal Error) no marshal_dump is defined for class Proc /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' /usr/lib/ruby/1.8/pstore.rb:326: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.12.5/lib/action_controller/base.rb:1015:in `close_session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:1057:in `process_cleanup_without_flash'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/flash.rb:147:in `process_cleanup_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:439:in `process_cleanup_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:126:in `process_cleanup_without_components'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/components.rb:182:in `process_cleanup'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:412:in `process_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!'' /usr/lib/ruby/1.8/fcgi.rb:600:in `each_cgi'' /usr/lib/ruby/1.8/fcgi.rb:597:in `each_cgi'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!'' /home/casparbl/user/V_O_2/public/dispatch.fcgi:24 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2006-Sep-16 13:47 UTC
Re: strange error, i have no idea what is wrong, please help
Clare wrote:> The images and directories get deleted, and then it gets redirected as > you''d expect, but then rails crashes, big time. Really have no idea why > it is dying and the logs which are usually very helpful mean nothing to > me. Any idea what the problem is? below is the relevent code and the > associated logs. >Thank you in advance for any light you can shine on this...> TypeError (no marshal_dump is defined for class Proc): > /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' >There''s something in your session (a Proc) object that can''t be serialized. I''d put a breakpoint at the end of your action (or at the end of any after_filters if they exist) and poke around to see what you''ve put in the session. Fred -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---