似乎这个问题的最后一个帖子由于某种原因被关闭了,所以我会试试我的运气......
我正在尝试运行一个简单的“rake db:migrate”命令。当我这样做时,我得到标题中的错误。是的,解决方案“看起来”很明显,但这不是因为我不知道我的 Rakefile 不包含对“rake/rdoctask”的任何引用。它似乎来自documentation.rake,但是当我尝试按照错误的建议更改该文件时,我得到了一个不同的错误。我发现一些帖子声明这是一个已知问题,但我发现没有任何内容表明如何修复或解决此问题。
有谁知道如何解决它?下面是带有 --trace 的 rake 命令的输出:
$ 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 时,我得到:
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 非常简单:
gem 'rails', '3.2.9'
gem 'rack','< 1.4.1'
gem 'mysql2', '< 0.3'
有什么想法吗?