2013-08-01 49 views
0

我在Windows8-64bit上使用Ruby 1.9.3。我的Ruby安装位于C:\Ruby193,Devkit位于C:\DevKit在Windows 8上的Ruby DevKit,仍然无法安装本机扩展

我遵循DevKit安装并取得成功。

然后指导问我通过运行gem install json --platform=ruby返回该错误来测试它(看起来具有的devkit安装之前类似):

注意:这个其他问题here告诉我到DevKit安装文件夹添加到环境PATH,我做到了,但仍然有相同的错误。

C:\Users\myname>gem install json --platform=ruby 
Building native extensions. This could take a while... 
ERROR: Error installing json: 
     ERROR: Failed to build gem native extension. 

    C:/Ruby193/bin/ruby.exe extconf.rb 
creating Makefile 

make 
generating generator-i386-mingw32.def 
compiling generator.c 
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0, 
       from c:/Ruby193/include/ruby-1.9.1/ruby.h:32, 
       from ../fbuffer/fbuffer.h:5, 
       from generator.c:1: 
c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:41:8: error: redefinition of 'struc 
t timespec' 
In file included from c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../. 
./../../i686-w64-mingw32/include/process.h:12:0, 
       from c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:62, 
       from c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223, 
       from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67, 
       from c:/Ruby193/include/ruby-1.9.1/ruby.h:32, 
       from ../fbuffer/fbuffer.h:5, 
       from generator.c:1: 
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw 
32/include/sys/types.h:89:8: note: originally defined here 
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0, 
       from c:/Ruby193/include/ruby-1.9.1/ruby.h:32, 
       from ../fbuffer/fbuffer.h:5, 
       from generator.c:1: 
c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:48:8: error: redefinition of 'struc 
t timezone' 
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:63:0, 
       from c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223, 
       from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67, 
       from c:/Ruby193/include/ruby-1.9.1/ruby.h:32, 
       from ../fbuffer/fbuffer.h:5, 
       from generator.c:1: 
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw 
32/include/time.h:260:8: note: originally defined here 
make: *** [generator.o] Error 1 

任何解决方案?谢谢

+0

你应该将自己的答案标记为“正确”,因为这会降低别人试图为你回答的机会。问题和答案可能仍然对你身处相同情况的其他人有用,我们都会犯错误。 –

+0

是的,当我被允许......在两天内我会接受它。谢谢 – hrsetyono

回答

1

对不起,我使用了错误的DevKit。

对于Ruby 1.9.3及以下版本,我们应该使用DevKit-tdm-32-4.5.2-20111229-1559-sfx.exemingw适用于2.0及以上版本。

现在效果很好。

相关问题