title: Rake error: Stack level too deep
body: <p>I know this is a common question, but I just started a project with the new Rails 3.1.0 and Ruby 1.9.2 p290</p>
  
  <p>On my first migrations I had already this error and I am not sure why. </p>
  
  <pre><code>Aurelien$ rake db:migrate --trace
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/version.rb:4: warning: already initialized constant MAJOR
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/version.rb:5: warning: already initialized constant MINOR
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/version.rb:6: warning: already initialized constant BUILD
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/version.rb:3: warning: already initialized constant NUMBERS
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/version.rb:9: warning: already initialized constant VERSION
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake.rb:26: warning: already initialized constant RAKEVERSION
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/early_time.rb:17: warning: already initialized constant EARLY
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/alt_system.rb:32: warning: already initialized constant WINDOWS
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/application.rb:28: warning: already initialized constant DEFAULT_RAKEFILES
  WARNING: Possible conflict with Rake extension: String#ext already exists
  WARNING: Possible conflict with Rake extension: String#pathmap already exists
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/task_arguments.rb:73: warning: already initialized constant EMPTY_TASK_ARGS
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/invocation_chain.rb:49: warning: already initialized constant EMPTY
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/dsl_definition.rb:143: warning: already initialized constant Commands
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_list.rb:44: warning: already initialized constant ARRAY_METHODS
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_list.rb:47: warning: already initialized constant MUST_DEFINE
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_list.rb:51: warning: already initialized constant MUST_NOT_DEFINE
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_list.rb:55: warning: already initialized constant SPECIAL_RETURN
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_list.rb:61: warning: already initialized constant DELEGATING_METHODS
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_list.rb:364: warning: already initialized constant DEFAULT_IGNORE_PATTERNS
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/file_list.rb:370: warning: already initialized constant DEFAULT_IGNORE_PROCS
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake.rb:64: warning: already initialized constant FileList
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake.rb:65: warning: already initialized constant RakeFileUtils
  ** Invoke db:migrate (first_time)
  ** Invoke environment (first_time)
  ** Execute environment
  rake aborted!
  stack level too deep
  /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/task.rb:162
  </code></pre>
  
  <p>I also removed the gems and re-tyring with db:reset
      source 'http://rubygems.org'</p>
  
  <pre><code>gem 'rails', '3.1.0'
  
  # Bundle edge Rails instead:
  # gem 'rails',     :git =&gt; 'git://github.com/rails/rails.git'
  
  gem 'sqlite3'
  
  #gem "rspec-rails", :group =&gt; [:test, :development]
  
  group :test do
    #gem "factory_girl_rails"
    #gem "capybara"
    #gem "guard-rspec"
    #gem "spork", "&gt; 0.9.0.rc"
    #gem "guard-spork"
  end
  </code></pre>
  
  <p>The rake commands work with <code>bundle exec</code>, but it would be nice to avoid using it. </p>
  
  <p>Thank you in advance for tips and answers.</p>
  
  <p>Aurelien</p>