1
votes

I have some problems with rake. My gemfile looks like this:

gem 'rails', '3.1.0.rc1'
gem "rake", "!= 0.9.0"

I get this error while trying to migrate:

[rake --prereqs] rake aborted! uninitialized constant Rake::DSL /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2482:in const_missing' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.1/lib/rake/tasklib.rb:8:in' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.1/lib/rake/tasklib.rb:6:in <module:Rake>' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.1/lib/rake/tasklib.rb:3:in' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.1/lib/rake/rdoctask.rb:20:in require' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.1/lib/rake/rdoctask.rb:20:in' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/tasks/documentation.rake:1:in require' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/tasks/documentation.rake:1:in' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/tasks.rb:16:in load' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/tasks.rb:16:inblock in ' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/tasks.rb:6:in each' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/tasks.rb:6:in' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/application.rb:189:in require' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/application.rb:189:inblock in initialize_tasks' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/railtie.rb:182:in call' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/railtie.rb:182:ineach' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/railtie.rb:182:in load_tasks' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/engine.rb:391:inload_tasks' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/application.rb:102:in load_tasks' /Users/nachtmeister/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc1/lib/rails/railtie/configurable.rb:28:inmethod_missing' /Users/nachtmeister/Dropbox/Development/Rails/craffft/Rakefile:7:in <top (required)>' /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2373:inload' /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2373:in raw_load_rakefile' /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2007:inblock in load_rakefile' /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2058:in standard_exception_handling' /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:2006:inload_rakefile' /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rake.rb:1991:in run' /Users/nachtmeister/.rvm/rubies/ruby-1.9.2-p136/bin/rake:35:in'

2

2 Answers

2
votes

Try Rake 0.8.7. Rake basically broke Rails with a backward-incompatible change. I have my Gemfile with rake '0.8.7'.

2
votes

Another alternative is using bundle exec rake, which will allow you to have both rake 0.8.7 and 0.9.1 installed, if you need 0.9.1.