Hi, I am trying to upgrade my existing 2.1 rails application to 2.3.3. Everything works fine in 2.1. Now after the upgrading I get either "stack level too deep" errors or "undefined method errors" if a I have requests in parallel or shortly after another (like I press f5 quickly twice). The first request works fine, the second raises this error. Just to be clear on this. The method exists, and everything works fine if I just hit f5 once. It ONLY happens if I hit f5 twice. Processing UserStatsController#total_raised (for 127.0.0.1 at 2009-09-09 08:04:13) [GET] Parameters: {"session_key"=>"1111111", "uid"=>"85", "application_name"=>"application"} [4;35;1mUser Load (0.2ms) [0m [0mSELECT * FROM `users` WHERE (`users`.`session_key` = ''1111111'') LIMIT 1 [0m [4;36;1mUser Load (0.2ms) [0m [0;1mSELECT * FROM `users` WHERE (`users`.`id` = 11) [0m Rendering /user_stats/total_raised.xml.builder [4;35;1mUser Columns (2.2ms) [0m [0mSHOW FIELDS FROM `users` [0m ActionView::TemplateError (undefined method `total_raised'' for #<User:0x7f2552edcaf0>) on line #2 of app/views/user_stats/total_raised.xml.builder: 1: xml.current_user do 2: xml.total_raised @current_user.total_raised, :type => ''float'' 3: end app/views/user_stats/total_raised.xml.builder:2:in `_run_builder_app47views47user_stats47total_raised46xml46builder'' builder (2.1.2) lib/builder/xmlbase.rb:134:in `call'' builder (2.1.2) lib/builder/xmlbase.rb:134:in `_nested_structures'' builder (2.1.2) lib/builder/xmlbase.rb:58:in `method_missing'' app/views/user_stats/total_raised.xml.builder:1:in `_run_builder_app47views47user_stats47total_raised46xml46builder'' vendor/plugins/restfulx/rails/./lib/restfulx.rb:69:in `render_without_simply_global'' thanks Christoph -- Posted via http://www.ruby-forum.com/.
On Sep 9, 4:16 pm, Christoph ---- <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > I am trying to upgrade my existing 2.1 rails application to 2.3.3. > Everything works fine in 2.1. > Now after the upgrading I get either "stack level too deep" errors or > "undefined method errors" if a I have requests in parallel or shortly > after another (like I press f5 quickly twice). > The first request works fine, the second raises this error. > > Just to be clear on this. The method exists, and everything works fineprobably issues with the code reloading stuff (if this is happening in development) or the code preloading (if this is happening in production) For the former errant requires are often a cause. For the latter this can be due to the fact that models are now loaded before the code at the bottom of initializer.rb is run Fred> if I just hit f5 once. It ONLY happens if I hit f5 twice. > > Processing UserStatsController#total_raised (for 127.0.0.1 at 2009-09-09 > 08:04:13) [GET] > Parameters: {"session_key"=>"1111111", "uid"=>"85", > "application_name"=>"application"} > [4;35;1mUser Load (0.2ms) [0m [0mSELECT * FROM `users` WHERE > (`users`.`session_key` = ''1111111'') LIMIT 1 [0m > [4;36;1mUser Load (0.2ms) [0m [0;1mSELECT * FROM `users` WHERE > (`users`.`id` = 11) [0m > Rendering /user_stats/total_raised.xml.builder > [4;35;1mUser Columns (2.2ms) [0m [0mSHOW FIELDS FROM `users` [0m > > ActionView::TemplateError (undefined method `total_raised'' for > #<User:0x7f2552edcaf0>) on line #2 of > app/views/user_stats/total_raised.xml.builder: > 1: xml.current_user do > 2: xml.total_raised @current_user.total_raised, :type => ''float'' > 3: end > > app/views/user_stats/total_raised.xml.builder:2:in > `_run_builder_app47views47user_stats47total_raised46xml46builder'' > builder (2.1.2) lib/builder/xmlbase.rb:134:in `call'' > builder (2.1.2) lib/builder/xmlbase.rb:134:in `_nested_structures'' > builder (2.1.2) lib/builder/xmlbase.rb:58:in `method_missing'' > app/views/user_stats/total_raised.xml.builder:1:in > `_run_builder_app47views47user_stats47total_raised46xml46builder'' > vendor/plugins/restfulx/rails/./lib/restfulx.rb:69:in > `render_without_simply_global'' > > thanks > Christoph > -- > Posted viahttp://www.ruby-forum.com/.
> probably issues with the code reloading stuff (if this is happening in > development) or the code preloading (if this is happening in > production) > For the former errant requires are often a cause. For the latter this > can be due to the fact that models are now loaded before the code at > the bottom of initializer.rb is run > > FredHi Fred, The problem occurs on both environments. The method is defined in the User model, so how can I change this behavior (or my code) to circumvent this. Shall I look for all ''require ..'' in config/initializers to see if they are causing the problem? thanks -- Posted via http://www.ruby-forum.com/.
On Sep 9, 4:55 pm, Christoph ---- <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi Fred, > The problem occurs on both environments. The method is defined in the > User model, so how can I change this behavior (or my code) to circumvent > this. > > Shall I look for all ''require ..'' in config/initializers to see if they > are causing the problem?They are only problematic if they require code in your app that could be autoloaded. Also worth seeing if there isn''t a method or column in your model that has since become a name used by rails. Fred> > thanks > -- > Posted viahttp://www.ruby-forum.com/.