我是Rails和一般編程的新手(目前正在使用3.0.1和ruby 1.9.2的書中學習)。在Rails中的棄用警告
當我做了rake db:migrate命令時,我得到了下面的棄用警告。我不確定這是因爲我使用的是Rails的稍舊版本,還是因爲版本而發生這種情況。無論如何,任何人都可以告訴我,如果我現在應該做什麼?
由於我是一個新手,詳細的答案將不勝感激。乾杯
$ 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/michaeljohnmitchell/.rvm/gems/[email protected]/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks'
更新與Rake文件
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
SampleApp::Application.load_tasks
您能否顯示您的rakefile? – nathanvda
我用我的rake文件更新了OP。感謝您的關注。 – Leahcim