在 Windows 上安装 starling
我正在尝试在我的 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
标头?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Gems
目前在 Windows 上有些损坏当时在 Windows 上有问题,但现在已修复。 以下解决方法适用于旧的一键安装程序版本的 Ruby; 你真的应该更新到新的基于 MinGW 的 RubyInstaller 和 DevKit ,该解决方法仍然有效,但更具未来性。强制安装该版本的事件机器:
$ 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 presentwas 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.安装似乎停留在安装 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)
我不知道这是否可行,但有人正在开发 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
现在所有的东西都安装好了,是不是可以在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.