运行rails rake命令我得到了这个弃用警告

时间:2011-07-29 00:34:30

标签: ruby-on-rails

DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from require at /Users/bm/.rvm/gems/ruby-1.8.7-p302@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:64)
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 Hs::Application#task called at /Users/bm/.rvm/gems/ruby-1.8.7-p302@hs/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'

刚刚创建了一个新的rails应用程序(rails 3.0.7)。

每次运行rake命令时都会看到上面的消息。

问题是什么?

1 个答案:

答案 0 :(得分:3)

您安装了最新版本的Rake,这与Rails 3.0.7不兼容。

坚持使用Gemfile:

gem 'rake', '~> 0.8.7'

并运行bundle update

之后调用您的rake任务前置:bundle exec