What is the new format for rake tasks? (task :t, arg, :needs => [deps] versus task :t, [args] => [deps])

血红的双手。 提交于 2019-12-03 09:55:21

I know it is sometimes hard to decipher but the error message gives you the new format:

task :t, [args] => [deps]

So for your example:

task :dump_graph, :species_id => :environment

http://www.postal-code.com/binarycode/2011/06/02/rake-needs-deprecated/

The usage which works for me is:

task :task_name, [:argument] => :environment

I guess if you had several dependencies to list, deps would need the array notation.

I've no idea why a single argument requires the array notation - running the rake task with --trace gives an error about the :argument symbol not responding to the empty? method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!