While running rake task with parameters i am getting this problem.
C:\projects\Test1>rake test_rake_task csv_header csv_column
(in C:/projects/CyncErp)
** Invoke annotate_models (first_time)
** Execute annotate_models
krunal get_开发者_运维问答model_names
model_name = csv_header
model_name = csv_column
rake aborted!
Don't know how to build task 'csv_header'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
c:/ruby/bin/rake:19:in `load'
c:/ruby/bin/rake:19
Any Solution ?
rake task parameters have to be formatted name=value
, and it attempts to use single words as task names.
I found out problem..
C:\projects\Test1>rake test_rake_task csv_header csv_column
This is trying to find out other rake task csv_header which i don't have it.
And it's trying to build csv_header so it's returning error.
rake aborted! Don't know how to build task 'csv_header'
That was not the proper way to pass parameters with Rake task..
If we want pass multiple parameter that we can pass it this way.
C:\projects\Test1>rake test_rake_task MODEL_NAMES=csv_header,csv_column
精彩评论