# No method error after upgrade from 2.1 to 2.3

**URL:** <https://www.ruby-forum.com/t/no-method-error-after-upgrade-from-2-1-to-2-3/175200>\
**Category:** Rails\
**Created:** [September 9, 2009, 5:16pm UTC](https://www.ruby-forum.com/t/no-method-error-after-upgrade-from-2-1-to-2-3/175200 "2009-09-09T17:16:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![christoph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christoph](https://www.ruby-forum.com/u/christoph)\
**Post date:** [September 9, 2009, 5:16pm UTC](https://www.ruby-forum.com/t/no-method-error-after-upgrade-from-2-1-to-2-3/175200/1 "2009-09-09T17:16:29Z")

</div>

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”}  
e[4;35;1mUser Load (0.2ms)e[0m e[0mSELECT \* FROM `users` WHERE  
(`users`.`session_key` = ‘1111111’) LIMIT 1e[0m  
e[4;36;1mUser Load (0.2ms)e[0m e[0;1mSELECT \* FROM `users` WHERE  
(`users`.`id` = 11) e[0m  
Rendering /user\_stats/total\_raised.xml.builder  
e[4;35;1mUser Columns (2.2ms)e[0m e[0mSHOW FIELDS FROM `users`e[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

---

<div class="post-metadata">

**Author:** ![christoph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christoph](https://www.ruby-forum.com/u/christoph)\
**Post date:** [September 9, 2009, 5:55pm UTC](https://www.ruby-forum.com/t/no-method-error-after-upgrade-from-2-1-to-2-3/175200/2 "2009-09-09T17:55:54Z")

</div>

> 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
> 
> Fred

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?

thanks

---

<div class="post-metadata">

**Author:** ![christoph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christoph](https://www.ruby-forum.com/u/christoph)\
**Post date:** [September 9, 2009, 5:26pm UTC](https://www.ruby-forum.com/t/no-method-error-after-upgrade-from-2-1-to-2-3/175200/3 "2009-09-09T17:26:08Z")

</div>

On Sep 9, 4:16 pm, Christoph ---- [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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 fine

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

Fred

---

<div class="post-metadata">

**Author:** ![christoph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christoph](https://www.ruby-forum.com/u/christoph)\
**Post date:** [September 9, 2009, 11:37pm UTC](https://www.ruby-forum.com/t/no-method-error-after-upgrade-from-2-1-to-2-3/175200/4 "2009-09-09T23:37:53Z")

</div>

On Sep 9, 4:55 pm, Christoph ---- [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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
