1

我正在尝试在 Ruby 中使用 Summarize gem,但是当我执行gem install summarize时,我得到:

Building native extensions.  This could take a while...
ERROR:  Error installing summarize:
    ERROR: Failed to build gem native extension.

C:/dev/Ruby/bin/ruby.exe extconf.rb
creating Makefile

nmake

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

cl -nologo -I. -IC:/dev/Ruby/lib/ruby/1.8/i386-mswin32 -IC:/dev/Ruby/lib
/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6  -c -Tcarticle.c
cl : Command line warning D4029 : optimization is not available in the standard
edition compiler
cl : Command line warning D4002 : ignoring unknown option '-Og-'
article.c
article.c(21) : fatal error C1083: Cannot open include file: 'stdio.h': No such
file or directory
NMAKE : fatal error U1077: 'C:\Windows\system32\cmd.exe' : return code '0x2'
Stop.

Gem files will remain installed in C:/dev/Ruby/lib/ruby/gems/1.8/gems/summarize-
1.0.3 for inspection.
Results logged to C:/dev/Ruby/lib/ruby/gems/1.8/gems/summarize-1.0.3/ext/summari
ze/gem_make.out

有任何想法吗??

4

1 回答 1

0

您正在使用 Microsoft C++ 编译器。安装 MinGW:它是您可以在 *nixes 中找到的 POSIX 工具集的一个端口(包括 GCC,GNU 编译器)。

http://www.mingw.org/

如果您使用 RubyInstaller 安装 Ruby,建议您使用打包好的 MinGW 版本:

http://rubyinstaller.org/add-ons/devkit/

于 2011-08-07T20:21:02.157 回答