I have seen the popular post on how to pass parameters to rake. I copy pasted sample code from that post and it is not working for me:
Rakefile.rb:
require 'rake'
task :my_task, [:arg1, :arg2] do |t, args|
puts "Args were: #{args}"
end
Then at the command line I run
rake my_task[1,2]
Error
rake aborted! Don't know how to build task 'my_task[1'
It looks like the comma is truncated. It may need to be escaped, but I don't know how. I tried rake my_task[1\,2]
and it only added a slash to the error. The answer has over 700 upvotes so...what am I doing wrong?
rake --version : rake, version 10.3.2
I'm using Console2 shell which says "Windows PowerShell" when I launch a new terminal instance.