Can any one explain ARGV,gets.chomp() command line arguments same .rbfile

In cmdline.rb file:

puts ARGV[0]
puts "Enter a no "
val =gets.chomp.to_i()

Come to command prompt
Go to taht file path>cmdline.rb prasad
cmdline.rb:15:ingets:no such file or directory-prasad(Errorno::ENOENT)
from cmdline.rb

the regular “gets” opens & reads ARGV[0], if given. Use $stdin.gets
instead.

thank you very much Niklas Cathor,it is very useful to me