2013/10/31 walles (Johan Walles) <johan.walles / gmail.com>:
> Bug #9067: IO.reopen broken in 1.9/2.0, worked in 1.8
> https://bugs.ruby-lang.org/issues/9067

>  ./reopen-fail.rb:8:in `reopen': <STDIN> can't change access mode from "r" to "w" (ArgumentError)
>         from ./reopen-fail.rb:8:in `<main>'
>
> AFAICT this makes it impossible to write Curses programs in Ruby that can accept input through pipes with newer versions of Ruby.

I recommend
  $stdin.reopen(IO.new(1, "r+"))
or
  $stdin.reopen("/dev/tty")
instead of
  $stdin.reopen($stdout)
-- 
Tanaka Akira