2008-10-03 37 views
5

我试图在Windows机器上安装Starling Gem。但是,每当我尝试安装它,我得到这个错误:在Windows上安装Starling

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 

什么我需要安装提供windows.h头?

回答

0

安装似乎停留在安装eventmachine gem。 这里最简单的方法可能是下载并安装windows的eventmachine二进制gem here

否则,您将需要一个编译器。 (我假设你没有)

6

宝石 somewhat broken在Windows目前 在Windows上打破了时间,但现在已经固定。以下解决方法适用于旧的一键式安装程序版本的Ruby;您应该更新到基于MinGW的新RubyInstallerDevKit,该解决方法仍然可行,但更具前景。

  • 找到一个版本的问题,创业板的(在这种情况下,它EventMachine的),有一个Win32的二进制文件。如果你看看RubyForge,你会看到,最后EventMachine的宝石拥有一个Win32的二进制版本为0.12.0
  • 队,将事件机版本进行安装:

    $ 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...

  • 现在安装尝试重新安装原来的宝石:

    $ 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...

要沃恩d不过,如果你现在运行gem update宝石会愚蠢地尝试并安装最新版本EventMachine的,正如我们已经知道了,也不会在Windows上构建的。这会导致gem更新完全停止。请参阅this question以了解如何解决特别烦恼。

0

现在,所有的东西都安装好了,它有可能让它在windows下工作吗?我没有在这台机器上实现fork()函数,因为Windows没有fork()进程。