How to accept user input in rake task

Recently I wrote a rake task in my rails project where I have to accept user inputs and do some stuff on that. My rake task looks like below.