From: Peter Vanderhaden Date: 2007-09-30T22:47:12+09:00 Subject: Re: Newbie needs help getting user input Sebastian, My Ruby installation must be corrupt, as it doesn't recognize gets. When I try your solution, I get the following error message: D:/scripts/ruby/f0.rb:10:in `gets': Bad file descriptor (Errno::EBADF) from D:/scripts/ruby/f0.rb:10 I'd assume the best way to correct this would be to reinstall Ruby? Would you agree? Thanks, PETERV Sebastian Hungerecker wrote: > Peter Vanderhaden wrote: >> print STDERR "Enter option: "; > > The ruby equivalent of this would be STDERR.print "Enter option: " but > why > STDERR? That hardly looks like an error message to me. > >> chomp ($option = ); > > That would be gets.chomp or STDIN.gets.chomp if you want to make > sure that > you read from STDIN. > >> I've searched the web and several books, but I haven't found anything >> that works. It also seems that my system doesn't recognize "gets". > > Your system is not supposed to recognize gets. If your ruby does not > recognize > gets, there is something seriously wrong with your ruby installation. > > > HTH, > Sebastian -- Posted via http://www.ruby-forum.com/.