0

I keep getting this same error message:

C:\Devkit>gem install json --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

D:/Ruby22/bin/ruby.exe -r ./siteconf20150813-3104-1rfxe1t.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating generator-i386-mingw32.def
compiling generator.c
In file included from d:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
             from ../fbuffer/fbuffer.h:5,
             from generator.c:1:
d:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:111:14: error: size of array        'ruby_chec
k_sizeof_voidp' is negative
In file included from d:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
             from ../fbuffer/fbuffer.h:5,
             from generator.c:1:
d:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function     '    rb_obj_freeze_inline':
 d:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1156:9: warning: cast to pointer      from integer of different size [-Wint-to-pointer-cast]
d:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1157:2: warning: cast to pointer from i
nteger of different size [-Wint-to-pointer-cast]


 make: *** [generator.o] Error 1

 make failed, exit code 2

 Gem files will remain installed in D:/Ruby22/lib/ruby/gems/2.2.0/gems/json-    1.8.3
 for inspection.
Results logged to D:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-     mingw32/2.2.0/jso
n-1.8.3/gem_make.out

There was a bunch more warnings about the casting to pointer from int. This is also not allowing my 'bundle install' either. I don't know what to change. I got the correct version of Devkit downloaded.

  • 2
    The size of a pointer differs between the invoked C compiler and the Ruby installation. That's one of the differences between 32-bit and 64-bit Windows. What does `ruby -rrbconfig/sizeof -e "p RbConfig::SIZEOF['void*']"` print? – cremno Aug 13 '15 at 20:08
  • 1
    Are you positive you're using the 32-bit DevKit? It looks like a DevKit mismatch to me. – Azolo Aug 14 '15 at 01:29
  • Oh wow. I was using the 64-bit DevKit! I had assumed since my computer is new and I'm using the Ruby above 2.0.0 that I would use the 64-bit installer. THANK YOU SO MUCH. – Tegan Straley Aug 14 '15 at 22:15

0 Answers0