On Apr 21, 2010, at 9:25 AM, John Briggs wrote: > It seems to work but often I get the following error: > > > [BUG] The handle is invalid. > > ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] > > -- control frame ---------- > --------------------------- > -- Ruby level backtrace > information----------------------------------------- > > [NOTE] > You may encounter a bug of Ruby interpreter. Bug reports are welcome. > For details: http://www.ruby-lang.org/bugreport.html > > > This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information. > > > and all the script crashes. > > I tried to run the same script on CentOS and it is working without > problems, but I can not stick to just one OS. I need this script to work > on every OS that Ruby runs on. > > So my question is: Does anybody know how to get rid of this error on > windows or maybe any workaround and what this error mean? You might want to try the release from ruby-lang.org [1]. It is built differently than the version you are running (I assume you got it from rubyinstaller.org). The Ruby from ruby-lang is built using Microsoft's development tools and calls into Win32 APIs directly. The version from rubyinstaller.org is built against MinGW which provides a POSIX emulation layer on top of most Windows APIs. As a result, the mingw version exercises more UNIX code paths than it does Windows code paths in the 1.9.x source. That said, you should still submit your code example as a bug report against the 1.9.x codebase. cr [1] http://www.ruby-lang.org/en/downloads/