Saturday, February 26, 2011

Getting error "uninitialized constant Rake::RDocTask" while running rake db:migrate

I am upgrading an existing rails application from Rails verison 2.3.5 to 3.0.3.
I added some files, and while running rake db:migrate, getting error:
uninitialized constant Rake::RDocTask
After long searching, running rake --trace and analyzing found the fix.
Added the line
require 'rake/testtask'
require 'rake/rdoctask'
below "require 'rake'" in Rakefile and it worked.

4 comments:

  1. Grt....thanks very much for sharing this Ritesh. It saved me a lot of time - AU

    ReplyDelete
  2. Glad to hear that & Thanks for your appreciation.. :)

    ReplyDelete
  3. Yes, thank you.. This was driving me crazy

    ReplyDelete