简体   繁体   中英

ERROR: Failed to build gem native extension on windows 7x64

I've been following the instructions provided by Development Kit for the rubyinstaller
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

When I try the last step I get the following error:
ERROR: Failed to build gem native extension

Here is the log file. http://pastebin.com/mLUCCVd3

I have been following the troubleshoot section with no avail.

Running windows7x64 This all started because I want to get the appfog tunnel working

Any help is appreciated

I see things that suggest a mismatch between 32 bit and 64 bit building.

Without doing anything except looking at your error log, I see two things.

First, "c:/Ruby192/include/ruby-1.9.1/ruby/ruby.h:112:14: error: size of array 'ruby_check_sizeof_voidp' is negative"

second, all the "warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]" messages.

in the first case, a 32 bit unsigned int value 0xFFFFFFFF is signed int value -1; in 64 bit, it's still 0x00000000FFFFFFFF. In the second case, sizeof(int) is 4 for both 32- and 64-bit windows; in win32, sizeof(*T) is 4, but in 64-bit windows, sizeof(*T) is 8, thus, in 32bit, sizeof(int) == sizeof(*T), but not in win64.

Look for contradictory architectures in your build scripts, command lines, and preprocessor definitions.

In your original attempt, it looks like you were using ruby 1.9.x. I was recently trying to install json in 1.9.3, and I was getting some of the same errors as you, specifically:

c:/Ruby192/include/ruby-1.9.1/ruby/missing.h:42:8: error: redefinition of 'struct timezone'

It turned out this was happening because I was using the latest version of devkit... You need to use the 'old' devkit which, I believe, has recently been renamed to 'tdm' which works for 1.9.x and 1.8.7 (I originally interpreted there information page to mean tdm was for 1.8.x due to skimming too fast and having done this in the past so many times, and the fact that with regard to the language itself, 1.9 is far more compatible to 2.0 than 1.8 is to 1.9).

In your second attempt (noted in your comment to the other answer) you switched to using ruby 2.0, which your gem may be flat out incompatible with, idk, that's a whole nother can of worms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM