ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead

后端 未结 10 700
无人及你
无人及你 2020-12-04 17:59

Seems the last post for this problem was closed for one reason or another so I\'ll try my luck...

I\'m trying to run a simple \"rake db:migrate\" command. When I do,

相关标签:
10条回答
  • 2020-12-04 18:44

    I run into this whenever I have a Bundler-based project and I'm using Ruby 1.9.2. Eventually I figure out that Bundler isn't managing the rdoc gem, and all I have to do to fix the problem is include rdoc in the Gemfile (or the gemspec if Gemfile is already configured to use it) and run bundle install.

    I never seem to run into this with 1.9.3 or 2.0.0, only 1.9.2.

    0 讨论(0)
  • 2020-12-04 18:47

    I had similar problem using rails 2.3.5 so as instructed in the trace message I have edited the Rakefile to require 'rdoc/task' instead of rake/rdoctask and installed rdoc gem.

    If you are using rake version > 10.0.0 . please edit your Rakefile

    from:

    require 'rake'
    require 'rake/testtask'
    require 'rake/rdoctask'
    require 'tasks/rails'
    

    to:

    require 'rake'
    require 'rake/testtask'
    require 'rdoc/task'
    require 'tasks/rails'
    

    If you don't want to edit the Rakefile you can switch back to older version of take like this

    gem uninstall rake -v 10.0.3
    gem install rake -v 0.8.7
    
    0 讨论(0)
  • 2020-12-04 18:48

    I ran into similar problem when migrating my old app to rails 2.3.15. I solved it by installing an older version of rake, and uninstalling current 10.0.3 version:

    gem install rake --version 0.8.7
    gem uninstall rake --version 10.0.3
    
    0 讨论(0)
  • 2020-12-04 18:57

    I had to fix this while not breaking on places that have old rake but not rdoc installed. I added a begin...rescue clause:

    begin
      require 'rake/rdoctask'
    rescue
      require 'rdoc/task'
    end
    
    0 讨论(0)
提交回复
热议问题