在Windows上安装starling

时间:2008-10-03 02:50:04

标签: ruby rubygems starling-server

我正在尝试在我的Windows机器上安装starling gem。但是,每当我尝试安装它时,我都会收到此错误:

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标题?

4 个答案:

答案 0 :(得分:6)

Gems 目前是Windows上的somewhat broken 当时在Windows上被打破了,但现在已经修复了。以下解决方法适用于旧的One-Click Installer版本的Ruby;你应该真正更新到新的基于MinGW的RubyInstaller和解决方法仍然适用的DevKit,但是更具前瞻性。

  • 找到具有win32二进制文件的问题gem版本(在本例中为 eventmachine )。如果查看RubyForge,您将看到拥有win32二进制文件的最后一个eventmachine gem是版本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:

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

请注意,如果您现在运行 gem update ,宝石将愚蠢地尝试安装最新版本的eventmachine,正如我们已经知道的那样,它不会在Windows上构建。这会导致gem更新完全停止。请参阅this question,了解如何解决特别烦恼。

答案 1 :(得分:0)

安装似乎停留在安装eventmachine gem上。 这里最简单的方法可能是为windows here

下载并安装eventmachine二进制gem

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

答案 2 :(得分:0)

我不知道这是否有效,但有人正在使用C编译器附带的Windows单击安装程序。

请参阅http://github.com/luislavena/rubyinstaller/tree/master

答案 3 :(得分:0)

现在一切都已安装,是否有可能让它在Windows下工作?我在这台机器上没有实现fork()函数,因为Windows没有fork()进程。