Reputation: 13558
I am trying to install the starling gem on my Windows machine. But, whenever I try to install it I get this error:
Building native extensions. This could take a while...
ERROR: Error installing starling:
ERROR: Failed to build gem native extension.
c:/ruby/bin/ruby.exe extconf.rb install starling -- --srcdir= c:\ruby-1.8.7-p72
checking for windows.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--srcdir=.
--curdir
--ruby=c:/ruby/bin/ruby
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0
.12.2 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/ext/gem_mak
e.out
What do I need to install to provide the windows.h
header?
Upvotes: 5
Views: 3308
Reputation: 20625
Gems is somewhat broken on Windows at present was at the time broken on Windows, but it's fixed now. The following workaround applies to the old One-Click Installer version of Ruby; you should really update to the new MinGW-based RubyInstaller and the DevKit to which the workaround still works, but is more future proof.
Force that version of event machine to install:
$ gem install eventmachine --version=0.12.0
Successfully installed eventmachine-0.12.0-x86-mswin32
1 gem installed
Installing ri documentation for eventmachine-0.12.0-x86-mswin32...
Installing RDoc documentation for eventmachine-0.12.0-x86-mswin32...
Now install try installing your original gem again:
$ gem install starling
Successfully installed ZenTest-3.10.0
Successfully installed memcache-client-1.5.0
Successfully installed SyslogLogger-1.4.0
Successfully installed starling-0.9.8
4 gems installed
Installing ri documentation for ZenTest-3.10.0...
Installing ri documentation for memcache-client-1.5.0...
Installing ri documentation for SyslogLogger-1.4.0...
Installing ri documentation for starling-0.9.8...
Installing RDoc documentation for ZenTest-3.10.0...
Installing RDoc documentation for memcache-client-1.5.0...
Installing RDoc documentation for SyslogLogger-1.4.0...
Installing RDoc documentation for starling-0.9.8...
Be warned though, if you now run gem update
gems will stupidly try and install the latest version of eventmachine which, as we already know, won't build on Windows. This causes gem update to stop completely. See this question to find out how to work around this particular annoyance.
Upvotes: 6
Reputation:
Now that everything is installed, is it possible to get it working under windows? I'm getting a fork() function unimplemented on this machine, because, Windows doesn't have a fork() process.
Upvotes: 0
Reputation: 527
I don't know if this will work but someone is working on a one click installer of Ruby under Windows that comes with a C compiler.
See http://github.com/luislavena/rubyinstaller/tree/master
Upvotes: 0