2013-08-01 50 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及以上版本。

現在效果很好。

相關問題