File: test.rb
STDOUT.sync=true
puts “File exists. Are you sure?”
STDOUT.flush
answer=gets.chomp
puts answer
executing this file with any parameters (e.g. ./test.rb bla) yields
this:
[:~/ruby]$ ./test.rb bla
File exists. Are you sure?
./test.rb:9:in `gets’: No such file or directory - “bla” (Errno::ENOENT)
from ./test.rb:9
[:~/ruby]$
What gives?!