It throws "Sys::Uname::Error: failed to parse display name of moniker" exception when used with sinatra on Windows. It works fine alone.
Here is the code to repeat the error:
class Web < Sinatra::Base
get '/test' do
Run the script in the command line with ruby web.rb, then type the address in the browser: http://localhost:4567/test. We got this error. Other methods such as Sys::Uname.version fails the same way.
And if we add WIN32OLE.ole_initialize before Sys::Uname.sysname it works fine.
I'm using ruby-1.9.3-p392 on Windows 7.
I'll take a look, thanks for the report.
I think this issue might be a bug in win32ole. Here's a patch that was proposed 2 years ago:
Should be fixed in 0.9.2.
Hi I still get this problem now by using sys-uname-0.9.2-universal-mingw32. Do I need to use the patch?
Hm, what version of Ruby are you using?
I couldn't get it to work with 1.9.3, even with that patch. YMMV. In any case, redefining Thread#initialize is something I leave to you.