When I tried to input standard input using gets like when solving an algorithm problem, I got the following error
$ ruby enc_main.rb new Traceback (most recent call last): 2: from enc_main.rb:12:in `<main>' 1: from enc_main.rb:12:in `gets' enc_main.rb:12:in `gets': No such file or directory @ rb_sysopen-new (Errno::ENOENT)
It was resolved by using the gets method with $stdin in the code below.
if ARGV == "new" puts "What's Name?" name = $stdin.gets