hrsetyono
hrsetyono

Reputation: 4464

Ruby DevKit on Windows 8, still can't install native extension

I'm using Ruby 1.9.3 on Windows8-64bit. My Ruby installation is in C:\Ruby193 and the Devkit is in C:\DevKit

I followed the DevKit installation and it's a success.

Then the guide asks me to test it by running gem install json --platform=ruby which returns this error (looks similar as before having DevKit installed):

Note: This other question here told me to add the DevKit installation folder to Environment PATH, I did it but still got same error.

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

Any solution? Thanks

Upvotes: 0

Views: 792

Answers (1)

hrsetyono
hrsetyono

Reputation: 4464

Sorry, I used the wrong DevKit.

For Ruby 1.9.3 and below, we should use DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe The mingw is for 2.0 and above.

It works great now.

Upvotes: 1

Related Questions