【问题标题】:Installing starling on Windows在 Windows 上安装八哥
【发布时间】:2008-10-03 02:50:03
【问题描述】:

我正在尝试在我的 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 标头?

【问题讨论】:

    标签: ruby rubygems starling-server


    【解决方案1】:

    Gems 目前在 Windows 上是 somewhat broken 当时在 Windows 上被破坏,但现在已修复。以下解决方法适用于旧的一键式安装程序版本的 Ruby;你真的应该更新到新的基于 MinGW 的 RubyInstallerDevKit 解决方法仍然有效,但更适合未来。

    • 找到具有 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,gems 会愚蠢地尝试安装最新版本的 eventmachine,我们已经知道,它不会在 Windows 上构建。这会导致 gem 更新完全停止。请参阅this question 了解如何解决这个特殊的烦恼。

    【讨论】:

      【解决方案2】:

      安装似乎卡在了安装 eventmachine gem 上。 这里最简单的方法可能是下载并安装适用于 windows 的 eventmachine 二进制 gem here

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

      【讨论】:

        【解决方案3】:

        我不知道这是否可行,但有人正在开发 Windows 下带有 C 编译器的一键式 Ruby 安装程序。

        http://github.com/luislavena/rubyinstaller/tree/master

        【讨论】:

          【解决方案4】:

          现在一切都安装好了,是否可以让它在windows下运行?我在这台机器上得到了一个未实现的 fork() 函数,因为 Windows 没有 fork() 进程。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2018-10-11
            • 1970-01-01
            • 1970-01-01
            • 2014-03-15
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多