ruby main.rb -i
main.rb:74:in `gets': No such file or directory - -i (Errno::ENOENT)
from main.rb:74:in `gets'
Ruby will automatically treat unparsed arguments as filenames, then open and read the files making the input available to
$<). By default,
gets reads from ARGF. To bypass that:
It has been suggested that you could use
STDIN instead of
$stdin, but it's usually better to use
Additionally, after you capture the input you want from
ARGV, you can use:
Then you'll be free to
gets without straggling data interfering.