Error when used with sinatra on Windows #1

rockuw opened this Issue Apr 13, 2013 · 7 comments

3 participants


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:

require 'sinatra'
require 'sys/uname'

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.

@djberg96 djberg96 closed this May 1, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment