Rails: how do I resolve the 'rake/rdoctask'' is deprecated' warning?

半城伤御伤魂 提交于 2019-11-29 10:46:58

Note this is fixed in later Rails 3.0.x versions (e.g., Rails 3.0.9).

The fix isn't in the top-level Rakefile but rather in the file mentioned in the error; it's just a general purpose notification:

if Rake.application
  Rake.application.deprecate('require \'rake/rdoctask\'', 'require \'rdoc/task\' (in RDoc 2.4.2+)', __FILE__)
end

It's actually related to something else, though; see this.

this is my rakefile

require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'rake/testtask'
require 'rdoc/task'

# add this (and perhaps make it conditional on Rails.version if you like):
Rake.application.options.ignore_deprecate = true

myapp::Application.load_tasks

that's working for bug notification.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!