Following is the way to pass command line argument to Rake task,
rake app:test argument_name=’Hello World’
And read command line argument in following rake task,
namespace :app do
desc ‘test’
task :test => :environment do |t|
puts ENV['argument_name']
end
end