如何解决rake db:使用'rake-10.0.4'迁移

时间:2013-04-14 08:54:42

标签: ruby-on-rails ruby

tim@ubuntu:~/rails_projects/sample_app$ bundle exec rake db:migrate
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.


tim@ubuntu:~/rails_projects/sample_app$ gem uninstall rake --version 10.0.4


You have requested to uninstall the gem:
    rake-10.0.4
addressable-2.3.3 depends on [rake (>= 0.7.3)]
diff-lcs-1.2.2 depends on [rake (~> 10.0)]
excon-0.20.1 depends on [rake (>= 0)]
heroku-api-0.3.9 depends on [rake (>= 0)]
launchy-2.2.0 depends on [rake (~> 10.0.3)]
mime-types-1.22 depends on [rake (~> 10.0)]
nokogiri-1.5.9 depends on [rake (>= 0.9)]
rack-1.2.8 depends on [rake (>= 0)]
railties-3.0.1 depends on [rake (>= 0.8.4)]
rspec-core-2.13.1 depends on [rake (~> 10.0.0)]
rspec-expectations-2.13.0 depends on [rake (~> 10.0.0)]
rspec-mocks-2.13.1 depends on [rake (~> 10.0.0)]
rspec-rails-2.13.0 depends on [rake (~> 10.0.0)]
thor-0.14.6 depends on [rake (>= 0.8)]
treetop-1.4.12 depends on [rake (>= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  ^CERROR:  Interrupted

对于rake-10.0.4上的这些依赖项,我不想回滚到rake-0.8.7。

这个问题还有其他解决办法吗?

1 个答案:

答案 0 :(得分:1)

如果您使用的是rake版本> 10.0.0。请编辑你的Rakefile

从:

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

为:

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