Reputation: 363
I am trying to run my rake task in the terminal with multiple arguments, however I keep getting an error:
rake populate:user['a' 'a']
DL is deprecated, please use Fiddle
rake aborted!
Don't know how to build task 'populate:user[a'
My rake file:
namespace :populate do
desc 'Populate data into our database'
task :user, [:username, :password] => :environment do |t, args|
// do stuff, also doesn't work when I delete everything inside here
end
end
I have also tried
rake populate:user[a, a]
It does run without any parameters:
rake populate:user
Upvotes: 3
Views: 5539
Reputation: 1050
You can try using
rake 'populate:user[a,a]'
Also you can ref https://cobwwweb.com/4-ways-to-pass-arguments-to-a-rake-task
Upvotes: 8
Reputation: 47591
Use the following:
rake populate:user[a,a]
There shouldn't be any need to add quotes around the entire rake task or around each argument (I don't think).
Upvotes: 2