Rake 0.9.1 导致 rake:db:migrate 产生弃用问题,无法降级到 0.8.7
我最近在 Gemfile 上运行了捆绑安装,并尝试 rake:db:migrate。此迁移不起作用,并输出:
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'
我在另一篇文章中读到我应该卸载 0.9.1,但由于某种原因,我拥有的某些 gem 在卸载后需要 0.9.1,所以我不知道如何解决此问题。有什么建议吗?
仅供参考,我的 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
I ran a bundle install on my Gemfile recently, and tried to 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. Any suggestions?
FYI my gemfile is:
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过像这样运行它:bundle exec rake db:migratebundle
exec命令在bundle定义的环境中运行您的请求,因此如果您的全局gems不同,这可能会有所帮助。
如果没有,您可以将
gem "rake", "0.8.7"
添加到您的 gemfile,bundle install
然后重试。您的其他依赖项仍然应该得到满足,因为您没有删除 0.9.1,只是要求捆绑执行程序使用不同的版本。Have you tried running it like so:
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.
If not, you can add
gem "rake", "0.8.7"
to your gemfile,bundle install
then try again. Your other dependency should still be met as you aren't removing 0.9.1, just asking bundle exec to use a different version.Rails 3.0.8 于昨天发布,包含 “修复 Rake 0.9.x 集成”。值得一试。
Rails 3.0.8 was released yesterday, and includes "Fixing Rake 0.9.x integration". Worth a try.