简体   繁体   English

Rake 0.9.1 导致 rake:db:migrate 产生弃用问题,无法降级到 0.8.7

[英]Rake 0.9.1 causing rake:db:migrate to yield deprecation issue, can't downgrade to 0.8.7

I ran a bundle install on my Gemfile recently, and tried to rake:db:migrate.我最近在我的 Gemfile 上运行了捆绑安装,并尝试 rake:db:migrate。 This migration didn't work, and outputs:此迁移不起作用,并输出:

WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method SampleApp::Application#task called at /Users/joshuaballoch/.rvm/gems/ruby-1.9.2-p180@rails3tutorial3/gems/railties-3.0.3/lib/rails/application.rb:214:in `initialize_tasks'

I read on another post that I should uninstall 0.9.1, but for some reason some gem I have requires 0.9.1 after the uninstall, so I don't know how to fix this.我在另一篇文章中读到我应该卸载 0.9.1,但由于某种原因,卸载后我的某些 gem 需要 0.9.1,所以我不知道如何解决这个问题。 Any suggestions?有什么建议么?

FYI my gemfile is:仅供参考,我的 gemfile 是:

source 'http://rubygems.org'

gem 'rails', '3.0.3'



gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
gem 'gravatar_image_tag', '1.0.0.pre2'
gem 'will_paginate', '3.0.pre2'



group :development do
    gem 'rspec-rails', '2.3.0'
    gem 'annotate-models', '1.0.4'
    gem 'faker', '0.3.1'
end

group :test do
    gem 'rspec', '2.3.0'
    gem 'webrat', '0.7.1'
    gem 'factory_girl_rails', '1.0'
end

Have you tried running it like so: bundle exec rake db:migrate您是否尝试过像这样运行它: bundle exec rake db:migrate

the bundle exec command runs your request in the environment defined by the bundle, so if your global gems differ this may help. bundle exec 命令在包定义的环境中运行您的请求,因此如果您的全局 gem 不同,这可能会有所帮助。

If not, you can add gem "rake", "0.8.7" to your gemfile, bundle install then try again.如果没有,您可以将gem "rake", "0.8.7"添加到您的 gemfile, bundle install然后重试。 Your other dependency should still be met as you aren't removing 0.9.1, just asking bundle exec to use a different version.您的其他依赖项仍然应该得到满足,因为您没有删除 0.9.1,只是要求 bundle exec 使用不同的版本。

Rails 3.0.8 was released yesterday, and includes "Fixing Rake 0.9.x integration" . Rails 3.0.8 昨天发布,包括 “Fixing Rake 0.9.x integration” Worth a try.值得一试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM