How to fix “rake/rdoctask is deprecated. use rdoc/task instead”

Seeing this?

Edit your Rakefile and change these lines:

to look like this:

You may need to add gem 'rdoc' to your Gemfile, too. While you’re at it, you might want to add rdoc/ to your .gitignore, too

Posted in Technical HOWTOs Tagged with: ,
  • goyox86

    Nice! I worked in a Rails 2.3.10 app:

    I did what you say and added ‘rdoc’ to my Gemfile.

    Thx very much.

  • MrBarrettGriffith


  • Emerson Lackey

    Thanks, helped me get my old 2.3.12 app up and running

  • Ajay Singh

    great post. very helpfull

  • Balach Hussain

    Hi, I got the deprecated error and did as suggested in your post and now I’m getting this error when I do rake db:create
    rake aborted!/Users/[my project directory]/Rakefile:11: syntax error, unexpected $end(See full trace by running task with –trace)

    Any hints?

  • Jirapong

    This remove annoying message, thank you very much.

  • Akshay

    worked….! Thanks

  • Suryakencanacorp

    i cannot mention it ..LOL

  • Ololade

    pls how do i locate my rakefile in th ruby installation directory?

  • Shailendra Pal Singh

    I dont find the below mentioned in my Rakefile:
    require ‘rake/rdoctask’ do |rdoc|
    …what should i do, as I m a Rails newbie…

  • Marcelo

    where can I find de RakeFile, because my project Rakefile does not contains the lines described above.


  • Martin Gregory

    Ignore it – just replace the “require” line as described, and it should be good (was for me!)

  • Martin Gregory

    Thanks – helped me rescue my old app!