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?