Yöntem 1

task :print do
  name = ENV['name']
  p name
end
$ rake print
nil

$ rake print name="askin"
"askin"

Yöntem 2

task :print, [:name, :age] do |task, args|
  puts task
  puts "name is: #{args.name}"
  puts "age is: #{args.age}"
end
$ rake print["osman",8]
print
name is: osman
age is: 8
Aşkın Gedik Ruby on Rails Developer