0

尝试执行时:

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/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `require'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `load'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `block in <top (required)>'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `each'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `<top (required)>'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/application.rb:213:in `require'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/application.rb:213:in `initialize_tasks'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/application.rb:139:in `load_tasks'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/Users/Charles/rails_projects/demo_app/Rakefile:7:in `<top (required)>'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/bin/ruby_noexec_wrapper:14:in `eval'
/Users/Charles/.rvm/gems/ruby-1.9.3-p429@rails3tutorial/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

此处提出的任何解决方案(特别是降级 gem,或修改 Rakefile(以下)工作(rake 版本 10.0.1)

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

DemoApp::Application.load_tasks

谢谢您的帮助,

4

2 回答 2

0

我假设您使用的是 rails 版本 3.0.5。将您的 Gemfile 更新为gem 'rails', '3.0.20'然后运行bundle update rails

于 2013-08-01T00:54:14.440 回答
0

将您的 rake 版本指定为 0.8.7 到 Gemfile 并执行命令 bundle exec rake db:migrate

于 2014-01-08T13:05:26.577 回答