无法从 Gem 安装 RCov
gem install rcov
错误:
Building native extensions. This could take a while... ERROR: Error installing rcov: ERROR: Failed to build gem native extension. "C:/Program Files/Ruby191/bin/ruby.exe" extconf.rb creating Makefile make Makefile:154: warning: overriding commands for target `C:/Program' Makefile:148: warning: ignoring old commands for target `C:/Program' make: *** No rule to make target `"/C/Program', needed by `callsite.o'. Stop. Gem files will remain installed in C:/Program Files/Ruby191/lib/ruby/gems/1.9.1/gems/rcov-0.9.8 for inspection. Results logged to C:/Program Files/Ruby191/lib/ruby/gems/1.9.1/gems/rcov-0.9.8/ext/rcovrt/gem_make.out
此输出是在将 DevKit 安装到 Ruby 根文件夹后出现的。
gem install rcov
Error:
Building native extensions. This could take a while... ERROR: Error installing rcov: ERROR: Failed to build gem native extension. "C:/Program Files/Ruby191/bin/ruby.exe" extconf.rb creating Makefile make Makefile:154: warning: overriding commands for target `C:/Program' Makefile:148: warning: ignoring old commands for target `C:/Program' make: *** No rule to make target `"/C/Program', needed by `callsite.o'. Stop. Gem files will remain installed in C:/Program Files/Ruby191/lib/ruby/gems/1.9.1/gems/rcov-0.9.8 for inspection. Results logged to C:/Program Files/Ruby191/lib/ruby/gems/1.9.1/gems/rcov-0.9.8/ext/rcovrt/gem_make.out
This output is now after installing DevKit - to the root Ruby folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
事实上,Gem 正在尝试为您的操作系统(显然是 Windows)编译软件。
如果您使用 RubyInstaller (而不是 http://ruby-lang.org),您应该添加 DevKit,您将获得 make、gcc 等工具,这些工具将能够本地编译许多 gem。
否则,您应该能够使用 Rcov gem 的 Win32 二进制版本。
遗憾的是,DevKit 并不总是能在 Win32 上编译所有 gem。但首先,有一个问题:您是否按照 DevKit 安装说明的第 2 步来编辑
fstab
文件?如果是这样,那么下一个最好的办法就是向 RubyInstaller Google 群组发送电子邮件,其中包含以下详细信息编译问题。我刚刚在我自己的 Windows 上尝试了来自 Rcov 站点的 Win32 二进制 rcovrt.so框,但它不能识别为有效的 Windows 映像,至少在我安装的 Ruby 1.9 中是这样……所以弄清楚如何使 DevKit 编译工作可能是您最好的选择。
Indeed, Gem is trying to compile the software for your OS (Windows, apparently).
If you are using the RubyInstaller (rather than the incomplete packages at http://ruby-lang.org), you should add the DevKit and you will get tools like make, gcc, etc. that will be able to compile many of the gems natively.
Otherwise, you should be able to use the Win32 binary version of the Rcov gem.
Sadly, the DevKit can't always compile every gem on Win32. But first, a question: did you follow Step 2 of the DevKit's installation instructions to edit the
fstab
file? If so, then the next best thing to do is email the RubyInstaller Google Group with details of the compilation problem.I just tried the Win32 binary rcovrt.so from the Rcov site on my own Windows box, but it doesn't recognize as a valid Windows image, at least with my Ruby 1.9 installation... so figuring out how to make the DevKit compilation to work may be your best bet.
您尝试使用的 gem 需要编译本机扩展(每个系统编译的代码),为此,它使用 makefile。你尝试过安装make吗?
The gem you're trying to use needs to compile native extensions (code which is compiled per system), and for that, it's using a makefile. Have you tried installing make?
你是对的,它使用的是 GNU make。一种选择是安装 cygwin 并安装 make(在 cygwin 安装程序中的 devel 树下)。
You are correct, it is using GNU make. One option is to install cygwin and install make (under the devel tree in cygwin setup).