Skip to content

Loading…

Cannot install gem on Windows Ruby 2.0.0p0 #77

Closed
jarmo opened this Issue · 17 comments

2 participants

@jarmo

Hi!

I can't install oj on Windows using Ruby 2.0.0p0.

C:\>gem install oj
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing oj:
        ERROR: Failed to build gem native extension.

    C:/bin/Ruby200-p0/bin/ruby.exe extconf.rb
>>>>> Creating Makefile for ruby version 2.0.0 on i386-mingw32 <<<<<
creating Makefile

make
generating oj-i386-mingw32.def
compiling cache.c
compiling cache8.c
cache8.c: In function 'slot_print':
cache8.c:97:3: warning: unknown conversion type character 'l' in format
cache8.c:97:3: warning: unknown conversion type character 'l' in format
cache8.c:97:3: warning: too many arguments for format
compiling dump.c
dump.c: In function 'dump_time':
dump.c:932:12: error: variable 'ts' has initializer but incomplete type
dump.c:932:12: error: invalid use of undefined type 'struct timespec'
dump.c:932:21: error: storage size of 'ts' isn't known
dump.c:932:21: warning: unused variable 'ts'
dump.c: In function 'dump_xml_time':
dump.c:1007:12: error: variable 'ts' has initializer but incomplete type
dump.c:1007:12: error: invalid use of undefined type 'struct timespec'
dump.c:1007:21: error: storage size of 'ts' isn't known
dump.c:1007:21: warning: unused variable 'ts'
make: *** [dump.o] Error 1


Gem files will remain installed in C:/bin/Ruby200-p0/lib/ruby/gems/2.0.0/gems/oj-2.0.9 for inspection.
Results logged to C:/bin/Ruby200-p0/lib/ruby/gems/2.0.0/gems/oj-2.0.9/ext/oj/gem_make.out
@ohler55
Owner

I can make some changes to the extconf.rb but could use some help testing. Are you willing to test some options?

@jarmo

Thanks!

I can help you test it out.

@ohler55
Owner

Great, I checked in a change that may work. Can you pull and test?

@jarmo

I'm not sure if i do it correctly, but this is the result:

C:\Users\Jarmo\Documents\Projects\Ruby\oj\ext\oj>ruby extconf.rb
>>>>> Creating Makefile for ruby version 2.0.0 on i386-mingw32 <<<<<
creating Makefile
make: [clean] Error 1 (ignored)
@ohler55
Owner

That is the first step. The second step is to type

make

That should build the code, hopefully without errors.

@jarmo

Not many errors indeed. Even too little for me. That's what confused me before when i executed make.

C:\Users\Jarmo\Documents\Projects\Ruby\oj\ext\oj>ruby extconf.rb
>>>>> Creating Makefile for ruby version 2.0.0 on i386-mingw32 <<<<<
creating Makefile
make: [clean] Error 1 (ignored)

C:\Users\Jarmo\Documents\Projects\Ruby\oj\ext\oj>make
make: *** [oj-i386-mingw32.def] Error 1

C:\Users\Jarmo\Documents\Projects\Ruby\oj\ext\oj>echo %ERRORLEVEL%
2
@ohler55
Owner

Not very helpful is it. Try editing the Makefile after it is created. Set V to 1 and see if that produces more output when you type make.

@jarmo

The problem was with make. I used the one which came with DevKit and it worked perfectly. In other words, it seems to compile as expected.

@ohler55
Owner

Cool. If the tests pass I will make a release. Would you mind running the tests in the test directory.
tests.rb
test_mimic.rb
test_fast.rb
test_saj.rb

Thanks.

@ohler55
Owner

uh, did you need the change in the extconf.rb file or not?

@jarmo

One of the tests are failing:

  1) Error:
test_time_object_early(Juice):
ArgumentError: time must be positive
    tests.rb:988:in `load'
    tests.rb:988:in `dump_and_load'
    tests.rb:399:in `test_time_object_early'

It is also failing when compiling with 1.9.3 though.

@jarmo

If i revert the change in extconf.rb then compilation will fail with the same errors as described in this issue.

@ohler55
Owner

Sadly that error comes from a ruby call. Apparently on Windows ruby does not times before 1970 when using seconds to set it. I can have that test skipped for Windows but you should keep in mind that using the unix time format with Windows will have problems with dates before 1970.

@ohler55
Owner

Can you send me the dump of the compile errors with 1.9.3?

@jarmo

I'm not sure i understand what you mean by that. I was refering to c1ec2b7 when i mentioned that compilation will fail with errors on Ruby 2.0 if that commit is reverted.

@ohler55
Owner

Did the 2.0.10 release take care of the problems other than the failed test for times before 1970?

@jarmo

Everything seems to be okay :) Thanks!

@ohler55 ohler55 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.