在 Windows 上安装 starling

发布于 2024-07-07 17:48:13 字数 1143 浏览 9 评论 0 原文

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

无声静候 2024-07-14 17:48:13

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

  • 找到问题 gem 的版本(在本例中为 eventmachine),该版本具有 win32 二进制文件。 如果您查看 RubyForge,您会看到最后一个拥有 win32 的 eventmachine gem二进制文件版本为 0.12.0
  • 强制安装该版本的事件机器:

    $ gem install eventmachine --version=0.12.0
    已成功安装 eventmachine-0.12.0-x86-mswin32
    安装了 1 个 gem
    正在安装 eventmachine-0.12.0-x86-mswin32 的 ri 文档...
    正在安装 eventmachine-0.12.0-x86-mswin32 的 RDoc 文档...

  • 现在安装,再次尝试安装原始 gem:

    $ gem install starling
    已成功安装 ZenTest-3.10.0
    已成功安装memcache-client-1.5.0
    成功安装SyslogLogger-1.4.0
    成功安装starling-0.9.8
    已安装 4 个 gem
    正在安装 ZenTest-3.10.0 的 ri 文档...
    正在安装 memcache-client-1.5.0 的 ri 文档...
    正在安装 SyslogLogger-1.4.0 的 ri 文档...
    正在安装 starling-0.9.8 的 ri 文档...
    正在安装 ZenTest-3.10.0 的 RDoc 文档...
    正在安装 memcache-client-1.5.0 的 RDoc 文档...
    正在安装 SyslogLogger-1.4.0 的 RDoc 文档...
    正在安装 starling-0.9.8 的 RDoc 文档...

不过请注意,如果您现在运行 gem update gem 会愚蠢地尝试安装最新版本的正如我们所知,eventmachine 不会在 Windows 上构建。 这会导致 gem 更新完全停止。 请参阅此问题了解如何解决此问题 特别烦人。

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.

  • Locate a version of the problem gem (in this case it's eventmachine) that has a win32 binary. If you look on RubyForge, you'll see that the last eventmachine gem to possess a win32 binary is version 0.12.0
  • 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.

听风吹 2024-07-14 17:48:13

安装似乎停留在安装 eventmachine gem 上。
最简单的方法可能是在此处

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

The install seems to be stuck on installing the eventmachine gem.
The easiest approach here may be to download and install the eventmachine binary gem for windows here

Otherwise you will need a compiler. (which I assume you don't have)

南薇 2024-07-14 17:48:13

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

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

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

月光色 2024-07-14 17:48:13

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文