ERROR: "rake / rdoctask" is deprecated and is no longer supported

Suddenly, I started getting the following error message:

(in /Users/me/.rvm/gems/ ruby-1.9.3-p125@mysql2 /gems/rails-0.9.5) rake aborted! ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead. /Users/me/.rvm/gems/ ruby-1.9.3-p125@mysql2 /gems/rails-0.9.5/Rakefile:3:in `<top (required)>' 

When I make s rails (in my development environment terminal - Mac Mountain Lion). This application is in production, so I went into the production environment, did a show with the package, and modified my Gemfile to copy the gem versions.

Here is what I have in my local development environment (which creates an error message).

 actionmailer (3.2.3) actionpack (3.2.3) activemodel (3.2.3) activerecord (3.2.3) activeresource (3.2.3) activesupport (3.2.3) annotate (2.4.1.beta1) arel (3.0.2) bcrypt-ruby (3.0.1) bootstrap-datepicker-rails (0.6.15) bootstrap-sass (2.0.2) builder (3.0.4) bundler (1.1.3) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.6.1) commonjs (0.2.6) devise (2.0.4) diff-lcs (1.1.3) erubis (2.7.0) execjs (1.4.0) factory_girl (3.2.0) factory_girl_rails (3.2.0) hike (1.2.1) i18n (0.6.4) journey (1.0.4) jquery-rails (2.0.2) json (1.7.1) less (2.2.2) less-rails (2.2.6) libv8 (3.3.10.4) mail (2.4.4) mime-types (1.21) multi_json (1.6.1) mysql2 (0.3.11) nokogiri (1.5.6) orm_adapter (0.0.7) polyglot (0.3.3) rack (1.4.5) rack-cache (1.2) rack-ssl (1.3.3) rack-test (0.6.2) rails (3.2.3) railties (3.2.3) rake (10.0.3) rdoc (3.4) rest-client (1.6.7) rspec (2.6.0) rspec-core (2.6.4) rspec-expectations (2.6.0) rspec-mocks (2.6.0) rspec-rails (2.6.1) sass (3.2.7) sass-rails (3.2.5) sprockets (2.1.3) stripe (1.7.0) therubyracer (0.10.1) thor (0.14.6) tilt (1.3.5) tinymce-rails (3.4.8) treetop (1.4.12) twitter-bootstrap-rails (2.1.0) tzinfo (0.3.37) uglifier (1.2.4) warden (1.1.1) webrat (0.7.1) 

I researched Stackoverflow and the web, and none of the suggestions worked (changing the version of gke gem to something else, like 0.8.7, etc., editing my Rakefile application to suppress obsolescence errors, etc.). I also added rdoc to my Rakefile, I needed "rdoc / task"

However, the same error.

+1
source share
5 answers

Just to help anyone who has had this hassle. If you are like me, then your problem is that the current version of the rails is 4, and you want to use an older version, for example 3.0.7.

If you set the rails fresh to study it, say, and the tutorial you are using is the version of rails 3.0.x or your work requires using the old version of the rails .. then you can get into this hole.

In my case, I received a relay project 3.0.7, which I threw, and he was asked to study the rails and make some improvements to this code.

So, I just started to study the rails and followed the tutorial until I got this error when doing "rake db: migrate"

 rake aborted! ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead. /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `require' /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `<top (required)>' /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `load' /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `block in <top (required)>' 

This happened because I used an older version of the rails .. in my case 3.0.7. If you ran "show bundle", as then, you can see that you are using rake version 10.0.0 or something like that ... and you need to use rake 0.9.2 ... where there is a problem coming from ..

The solution for me was to (a) add a gem to my gemfile and (b) install the package

So in my gemfile I added:

 gem 'rake', '0.9.2' 

Then did

 'bundle install' 

Received this message:

 You have requested: rake = 0.9.2 The bundle currently has rake locked at 10.1.0. Try running `bundle update rake` 

And I did it ...

 bundle update rake. 

And everything went well.

then when I did therake db: migrate, it just worked.

Hope this helps someone. View.

PS: if you are new to rails, like me, and you inherit the old rails application, then for God's sake NEVER run a package update, otherwise you will end up in a world of pain. This command updates all your gems to the latest versions, and you get a lot of incompatibility issues. The only way out of this is if you are fortunate enough to install git and do a "git checkout" to return ...

+6
source

I encountered the same problem when trying to install stones with the rake gems:install command rake gems:install my version of rails is rails2.3.2 and I have rvm installed. my gem list

 actionmailer (2.3.2) actionpack (2.3.2) activerecord (2.3.2) activeresource (2.3.2) activesupport (2.3.2) bundler (1.3.5) rails (2.3.2) rake (10.0.4) rubygems-bundler (1.1.1) rvm (1.11.3.7) 

therefore deleted a rake a command

rvm use ruby-1.8.7-p371@global && gem uninstall rake -v 10.0.4

then i installed rake of an older version

rvm use ruby-1.8.7-p371@global && gem install rake -v 0.8.7

now rake gems:install works fine

Hope this can help someone!

+4
source

Upgrading to rails 4.0.0 I have the same error.

 rails -v (in /Users/oma/.rvm/gems/ruby-2.0.0-p247/gems/rails-0.9.5) rake aborted! ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead. /Users/oma/.rvm/gems/ruby-2.0.0-p247/gems/rails-0.9.5/Rakefile:3:in `<top (required)>' (See full trace by running task with --trace) 

To update, I deleted the version number in the Gemfile

  source 'https://rubygems.org' gem 'rails' # NO VERSION 

and did a bundle update , as I thought it would select the latter. But for some reason I got rails 0.9.5 . It seems like some kind of practical joke, really, lol

 $ gem list rails rails (4.0.1.rc2, 4.0.0, 0.9.5) 

I can’t tell you with 100% certainty that this was the reason, but we were two people working in the same branch and having the same error. The fix worked for both of us. Just

specify rails version!

 $gem uninstall rails -v 0.9.5 Gemfile source 'https://rubygems.org' gem 'rails', '4.0.0' 

then group, run rails -v, giggle (or cry) and go back to creating

+1
source

Take a look at fooobar.com/questions/258033 / ...

Another option is to use (example taken from Redmine Rakefile)

 require 'rdoc' require 'rdoc/task' 

Instead

 require 'rake/testtask' require 'rake/rdoctask' 
0
source

The following works for me using ruby ​​1.9.3p448 (printable version 2013-06-27 41675):

1) Use rake version 10.1.0 (add the following to your Gemfile):

 gem 'rake', '10.1.0' 

(Note that you can probably use a different version, but the line number below may change.)

2) Comment out line 54 of your Rakefile and replace it as follows:

 #require 'rake/rdoctask' gem 'rdoc', ">= 2.4.2" require 'rdoc/task' 

3) Test

 $ bundle install $ bundle exec rake 
0
source

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


All Articles