Rails: how do I resolve the "rake / rdoctask" warning "out of date"?

Just a warning: I'm noob rails.

When I run:

rake db:migrate 

I get this failure warning:

 WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. at /Users/username/Code/rails/appname/rake/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb 

I use:

  • Rails 3.0.1
  • Rake 0.9.2.2
  • RSpec 2.0.1
  • RDoc 3.12

If I remove the rake 0.9.2.2 and use 0.8.7, then there are no warnings, but I probably do not consider this a solution.

After searching on Google, many sites say that I need to update the line in my Rakefile (basically, "rake / rdoctask for the request" rdoc / task is required to change). However, my Rakefile looks like this:

 require File.expand_path('../config/application', __FILE__) require 'rake' AppName::Application.load_tasks 

There is no need to replace the expression. When I add require 'rdoc / task', it does not work. When I search for a project for the outdated "rake / rdoctask", there are no results. So why are the rails complaining?

edit: Not sure if that matters, but here is my gemfile:

 source 'http://rubygems.org' gem 'rails', '3.0.1' gem 'sqlite3-ruby', :require => 'sqlite3' group :development, :test do gem 'rspec-rails', '2.0.1' gem 'annotate-models', '1.0.4' end group :test do gem 'rspec', '2.0.1' gem 'webrat', '0.7.1' gem 'spork', '0.8.4' end 
+6
source share
2 answers

Note. This has been fixed in later versions of Rails 3.0.x (e.g. Rails 3.0.9).

The fix is ​​not at the top level of the Rakefile, but rather in the file indicated in the error; this is just a general notice:

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

In fact, it is connected with something else; cm. .

+7
source

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 

which works for error notification.

+2
source

Source: https://habr.com/ru/post/904915/


All Articles