Cannot install thin on windows Cannot install thin on windows ruby ruby

Cannot install thin on windows


Installing from the git or rubygems repositories no longer works (currently) under 1.9.2 or 1.9.3 (confirmed still broken on 2012-June-22). Instead, you need to simply:

gem install eventmachine --pregem install thin

Note that on 2012-June-18 the current prerelease was renamed to 1.0.0.rc.1, so there is a possibility that 'soon' the version that works with Windows will become the official release and this will no longer be a problem.


If you try to build the gem under 1.9.2 from the github repo you may see this (included for search engine hits):

C:\eventmachine> rake build(in C:/eventmachine)cd extC:/Ruby/bin/ruby.exe extconf.rbchecking for rb_trap_immediate in ruby.h,rubysig.h... *** extconf.rb failed ***Could not create Makefile due to some reason, probably lack of necessarylibraries and/or headers.  Check the mkmf.log file for more details.

If you try to install the gem under 1.9.3 from the rubygems repo you may see this (included for search engine hits):

C:\>gem install eventmachineTemporarily enhancing PATH to include DevKit...Building native extensions.  This could take a while...ERROR:  Error installing eventmachine:        ERROR: Failed to build gem native extension.        C:/Ruby193/bin/ruby.exe extconf.rbchecking for rb_trap_immediate in ruby.h,rubysig.h... nochecking for rb_thread_blocking_region()... yeschecking for inotify_init() in sys/inotify.h... nochecking for __NR_inotify_init in sys/syscall.h... nochecking for writev() in sys/uio.h... nochecking for rb_thread_check_ints()... yeschecking for rb_time_new()... yeschecking for windows.h... yeschecking for winsock.h... yeschecking for main() in -lkernel32... yeschecking for main() in -lrpcrt4... yeschecking for main() in -lgdi32... yeschecking for main() in -lssl... nocreating Makefilemakegenerating rubyeventmachine-i386-mingw32.defcompiling binder.cppcc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++In file included from binder.cpp:20:0:project.h:85:0: warning: "FD_SETSIZE" redefined:0:0: note: this is the location of the previous definitionIn file included from project.h:137:0,                 from binder.cpp:20:binder.h:35:34: warning: type qualifiers ignored on function return typeIn file included from project.h:138:0,                 from binder.cpp:20:em.h:91:47: warning: type qualifiers ignored on function return typeem.h:92:76: warning: type qualifiers ignored on function return typeem.h:93:56: warning: type qualifiers ignored on function return typeem.h:95:57: warning: type qualifiers ignored on function return typeem.h:96:60: warning: type qualifiers ignored on function return typeem.h:97:58: warning: type qualifiers ignored on function return typeem.h:98:55: warning: type qualifiers ignored on function return typeem.h:99:36: warning: type qualifiers ignored on function return typeem.h:101:47: warning: type qualifiers ignored on function return typeem.h:106:42: warning: type qualifiers ignored on function return typeem.h:123:45: warning: type qualifiers ignored on function return typeem.h:132:36: warning: type qualifiers ignored on function return typeIn file included from project.h:145:0,                 from binder.cpp:20:eventmachine.h:45:61: warning: type qualifiers ignored on function return typeeventmachine.h:46:112: warning: type qualifiers ignored on function return typeeventmachine.h:47:69: warning: type qualifiers ignored on function return typeeventmachine.h:49:73: warning: type qualifiers ignored on function return typeeventmachine.h:62:75: warning: type qualifiers ignored on function return typeeventmachine.h:63:74: warning: type qualifiers ignored on function return typeeventmachine.h:64:77: warning: type qualifiers ignored on function return typeeventmachine.h:65:41: warning: type qualifiers ignored on function return typeIn file included from project.h:145:0,                 from binder.cpp:20:eventmachine.h:99:60: warning: type qualifiers ignored on function return typeeventmachine.h:100:58: warning: type qualifiers ignored on function return typeeventmachine.h:102:60: warning: type qualifiers ignored on function return typeeventmachine.h:105:41: warning: type qualifiers ignored on function return typecompiling cmain.cppcc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++In file included from cmain.cpp:20:0:project.h:85:0: warning: "FD_SETSIZE" redefined:0:0: note: this is the location of the previous definitionIn file included from project.h:137:0,                 from cmain.cpp:20:binder.h:35:34: warning: type qualifiers ignored on function return typeIn file included from project.h:138:0,                 from cmain.cpp:20:em.h:91:47: warning: type qualifiers ignored on function return typeem.h:92:76: warning: type qualifiers ignored on function return typeem.h:93:56: warning: type qualifiers ignored on function return typeem.h:95:57: warning: type qualifiers ignored on function return typeem.h:96:60: warning: type qualifiers ignored on function return typeem.h:97:58: warning: type qualifiers ignored on function return typeem.h:98:55: warning: type qualifiers ignored on function return typeem.h:99:36: warning: type qualifiers ignored on function return typeem.h:101:47: warning: type qualifiers ignored on function return typeem.h:106:42: warning: type qualifiers ignored on function return typeem.h:123:45: warning: type qualifiers ignored on function return typeem.h:132:36: warning: type qualifiers ignored on function return typeIn file included from project.h:145:0,                 from cmain.cpp:20:eventmachine.h:45:61: warning: type qualifiers ignored on function return typeeventmachine.h:46:112: warning: type qualifiers ignored on function return typeeventmachine.h:47:69: warning: type qualifiers ignored on function return typeeventmachine.h:49:73: warning: type qualifiers ignored on function return typeeventmachine.h:62:75: warning: type qualifiers ignored on function return typeeventmachine.h:63:74: warning: type qualifiers ignored on function return typeeventmachine.h:64:77: warning: type qualifiers ignored on function return typeeventmachine.h:65:41: warning: type qualifiers ignored on function return typeIn file included from project.h:145:0,                 from cmain.cpp:20:eventmachine.h:99:60: warning: type qualifiers ignored on function return typeeventmachine.h:100:58: warning: type qualifiers ignored on function return typeeventmachine.h:102:60: warning: type qualifiers ignored on function return typeeventmachine.h:105:41: warning: type qualifiers ignored on function return typecmain.cpp:98:71: warning: type qualifiers ignored on function return typecmain.cpp:109:122: warning: type qualifiers ignored on function return typecmain.cpp:119:79: warning: type qualifiers ignored on function return typecmain.cpp:129:83: warning: type qualifiers ignored on function return typecmain.cpp:260:85: warning: type qualifiers ignored on function return typecmain.cpp:270:84: warning: type qualifiers ignored on function return typecmain.cpp:280:88: warning: type qualifiers ignored on function return typecmain.cpp:290:51: warning: type qualifiers ignored on function return typecmain.cpp:300:70: warning: type qualifiers ignored on function return typecmain.cpp:320:55: warning: type qualifiers ignored on function return typecmain.cpp:546:70: warning: type qualifiers ignored on function return typecmain.cpp:669:68: warning: type qualifiers ignored on function return typecmain.cpp: In function 'int evma_send_file_data_to_connection(long unsigned int, const char*)':cmain.cpp:752:6: error: cannot convert 'stat*' to '_stati64*' for argument '2' to 'int _fstati64(int, _stati64*)'make: *** [cmain.o] Error 1Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10 for inspection.Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out


First, install the DevKit from the RubyInstaller for Windows website (which it appears you have already done).

Then install eventmachine separately from the git repository as Roger shows.

> gem install specific_installSuccessfully installed backports-1.18.1Successfully installed specific_install-0.2.32 gems installed...> gem specific_install -l http://github.com/eventmachine/eventmachine.gitgit installing from http://github.com/eventmachine/eventmachine.git...Successfully built RubyGemName: eventmachineVersion: 0.12.11File: eventmachine-0.12.11.gemTemporarily enhancing PATH to include DevKit...Building native extensions.  This could take a while...Successfully installed eventmachine-0.12.111 gem installed...successfully installed

You should then be able to install thin from the gem.

> gem install thinTemporarily enhancing PATH to include DevKit...Successfully installed thin-1.2.7-x86-mingw321 gem installed ...> thin startUsing rack adapterThin web server (v1.2.7 codename No Hup)Maximum connections set to 1024Listening on 0.0.0.0:3000, CTRL+C to stop


Try the running the following

gem install thin –ignore-dependencies

If it fails retry installing rack and eventmachine and then re-running the above command.

gem install rackgem install eventmachine -lgem install thin –ignore-dependencies