From: revision17@... (Revision17) Date: 2004-02-13T13:29:57+09:00 Subject: Novice Question: Getting "bad file descriptor error" when trying to use gets in ruby 1.8.1 for windows Hi I'm trying to run this code: while (line = gets) puts "The given line is #{line}" if line =~ /^eval:(.*)$/ puts "#$1 # => #{eval $1}" end end That I found on a tutorial website. Ruby gives me this error when I try to run it: >ruby guessnumber.rb higuessnumber.rb:4:in `gets': Bad file descriptor (Errno::EBADF) from guessnumber.rb:4 >Exit code: 1 Why is this happening?