错误:'rake/rdoctask' 已过时且不再受支持.改用“rdoc/task"(在 RDoc 2.4.2+ 中可用) [英] ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead

查看:33
本文介绍了错误:'rake/rdoctask' 已过时且不再受支持.改用“rdoc/task"(在 RDoc 2.4.2+ 中可用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎这个问题的最后一个帖子由于某种原因被关闭,所以我会试试我的运气...

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

我正在尝试运行一个简单的rake db:migrate"命令.当我这样做时,我收到标题中的错误.是的,解决方案看起来"很明显,但这并不是因为我的 Rakefile 不包含对rake/rdoctask"的任何引用.它似乎来自documentation.rake,但是当我尝试按照错误建议更改该文件时,我收到了不同的错误.我发现有几篇帖子宣称这是一个已知问题,但我没有发现任何内容表明如何修复或解决此问题.

I'm trying to run a simple "rake db:migrate" command. When I do, I get the error in the title. Yes, the solution "appears" obvious but it's not because I don't my Rakefile does not contain any references to 'rake/rdoctask'. It seems to be coming from documentation.rake but when I try to change that file as recommended by the error, I get a different error. I have found a couple of posts declaring this to be a known issue but nothing I've found indicates how to fix or work around this.

有没有人有任何想法如何解决它?下面是带有 --trace 的 rake 命令的输出:

Does anyone have any ideas how to fix it? Below is the output from the rake command with a --trace:

$ rake --trace db:migrate
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rdoctask.rb:1:in `<top (required)>'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/tasks/documentation.rake:2:in `require'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/tasks/documentation.rake:2:in `<top (required)>'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/tasks.rb:15:in `load'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/tasks.rb:15:in `block in <top (required)>'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/tasks.rb:6:in `each'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/tasks.rb:6:in `<top (required)>'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:213:in `require'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:213:in `initialize_tasks'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:139:in `load_tasks'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
    C:/developer/skknobara/Rakefile:7:in `<top (required)>'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
    C:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
    C:/Programs/Ruby193/bin/rake:23:in `load'
    C:/Programs/Ruby193/bin/rake:23:in `<main>'

<小时>

我发现我的 Gemfile 中有 rails 3.0.3,所以我将其更改为 3.2.9,但是现在当我运行 rake db:migrate 时,我得到:


I discovered that I had rails 3.0.3 in my Gemfile so I changed it to 3.2.9, but now when I run rake db:migrate I get:

rake aborted!
Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rails (= 3.2.9) x86-mingw32 depends on
      rack (~> 1.4.0) x86-mingw32

    rack (1.2.5)

我不确定错误是什么意思,但gem list rack"显示我同时安装了 1.4.1 和 1.4.0.我的 Gemfile 非常简单:

I'm not sure what the error means but "gem list rack" shows I have both 1.4.1 and 1.4.0 installed. My Gemfile is pretty simple:

gem 'rails', '3.2.9'
gem 'rack','< 1.4.1'
gem 'mysql2', '< 0.3'

有什么想法吗?

推荐答案

我在使用 rails 2.3.5 时遇到了类似的问题,因此按照跟踪消息中的指示,我编辑了 Rakefile 以要求使用 'rdoc/task' 而不是 rake/rdoctask并安装了 rdoc gem.

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.

如果您使用 rake 版本 > 10.0.0 .请编辑您的 Rakefile

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

来自:

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

到:

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

如果你不想编辑 Rakefile,你可以像这样切换回旧版本的 take

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

这篇关于错误:'rake/rdoctask' 已过时且不再受支持.改用“rdoc/task"(在 RDoc 2.4.2+ 中可用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆