2

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?

4

1 回答 1

3

发现问题:在某些任务中,我们已经ActionView::Helpers包含(例如使用 number_to_currency),这就是导致堆栈级别太深错误的原因。

当您创建一个全新的应用程序和一个带有 .rake 文件的 .rake 文件时,也会发生这种情况include ActionView::Helpers。我将在 Ruby on Rails 上打开一个关于此的问题。

于 2013-02-15T16:57:34.717 回答