Rake 0.9 breaks. !!

Posted on June 27, 2011

0


Recently I was doing a rails project where I did a normal

rake db:migrate

I got an error like this:

rake aborted! uninitialized constant Rake::DSL /usr/lib/ruby/1.9.1/rake.rb:2482:in `const_missing' 
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:8:in `<class:TaskLib>' 
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:6:in `<module:Rake>' 
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:3:in `<top (required)>' 
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in `require'
 /usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in `<top (required)>' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `require' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
 /usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `load'
 /usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `block in <top (required)>' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `each' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `<top (required)>' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:214:in `require' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:214:in `initialize_tasks' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks' 
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing' 
/home/mikhail/test_app/Rakefile:7:in `<top (required)>' /usr/lib/ruby/1.9.1/rake.rb:2373:in `load' 
/usr/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile' /usr/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile' 
/usr/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling' /usr/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
 /usr/lib/ruby/1.9.1/rake.rb:1991:in `run'  /usr/bin/rake:31:in `<main>'.
I had no clue what this error was. Then I (ofcourse) googled it and saw this tweet  by DHH and found the fix. Actually there is some problem in rake 0.9 so use:
gem "rake", "0.8.7" in your rake file.  
Advertisements
Posted in: Rails app