shadowmaru
shadowmaru

Reputation: 141

stack level too deep error when running any rake task

I'm upgrading an application from Rails 3.0 to Rails 3.1. The tests run ok, as the unicorn server. However, when I run any rake task (being 'rake routes' or even 'rake about'), it returns 'stack level too deep'. This doesn't happen using Rails 3.0.20.

I've tracked down the Rails stack, requiring the libraries individually, and the error happens when I require ActiveRecord or ActionController.

I've tried different versions of Rails (from 3.1.0 until 3.2.11), different versions of rake (0.8.7, 0.9.2, 10.0.3), different versions of bundler (1.1.5 and 1.2.3) and the result is the same. I always use with 'bundle exec', and tried using binstubs ('bin/rake').

I'm still not using the asset pipeline, so no sass-rails issue.

I'm using RVM under OS X Mountain Lion and also reinstalled ruby 1.9.3-p374. I've even used Ubuntu under Vagrant, same results.

Did anyone have the same problem?

Upvotes: 2

Views: 596

Answers (1)

shadowmaru
shadowmaru

Reputation: 141

Found the problem: in some tasks, we have ActionView::Helpers included (to use number_to_currency, for example), and that is what's causing the stack level too deep error.

This also happens when you create a brand new app and a single .rake file with include ActionView::Helpers. I'll open an issue on Ruby on Rails about that.

Upvotes: 3

Related Questions