0

我试图安装 oj ruby​​ gem

gem install oj -v '1.3.5'

这是输出日志 C:/Ruby192/bin/ruby.exe extconf.rb

为 ruby​​ 版本 1.9.2 创建 Makefile <<<<< 创建 Makefile

    make
    C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_oj'"  > oj-i386-mingw32.def
    gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I.   -DRUBY_TYPE=ruby -DRUBY_RUBY -DRUBY_VERSION=1.9.2 -DRUBY_VERSION_MAJOR=1 -DRUBY_VERSION_MINOR=9 -DRUBY_VERSION_MICRO=2 -DHAS_RB_TIME_TIMESPEC=0 -DHAS_ENCODING_SUPPORT=1 -DHAS_NANO_TIME=1 -DHAS_RSTRUCT=1 -DHAS_IVAR_HELPERS=1 -DHAS_EXCEPTION_MAGIC=0 -DHAS_PROC_WITH_BLOCK=1 -DHAS_TOP_LEVEL_ST_H=0 -DSAFE_CACHE -Wall -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -o cache.o -c cache.c
    cache.c: In function 'oj_cache_new':
    cache.c:54:5: warning: implicit declaration of function 'bzero'
    cache.c:54:5: warning: incompatible implicit declaration of built-in function 'bzero'
    gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I.   -DRUBY_TYPE=ruby -DRUBY_RUBY -DRUBY_VERSION=1.9.2 -DRUBY_VERSION_MAJOR=1 -DRUBY_VERSION_MINOR=9 -DRUBY_VERSION_MICRO=2 -DHAS_RB_TIME_TIMESPEC=0 -DHAS_ENCODING_SUPPORT=1 -DHAS_NANO_TIME=1 -DHAS_RSTRUCT=1 -DHAS_IVAR_HELPERS=1 -DHAS_EXCEPTION_MAGIC=0 -DHAS_PROC_WITH_BLOCK=1 -DHAS_TOP_LEVEL_ST_H=0 -DSAFE_CACHE -Wall -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -o cache8.o -c cache8.c
    gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I.   -DRUBY_TYPE=ruby -DRUBY_RUBY -DRUBY_VERSION=1.9.2 -DRUBY_VERSION_MAJOR=1 -DRUBY_VERSION_MINOR=9 -DRUBY_VERSION_MICRO=2 -DHAS_RB_TIME_TIMESPEC=0 -DHAS_ENCODING_SUPPORT=1 -DHAS_NANO_TIME=1 -DHAS_RSTRUCT=1 -DHAS_IVAR_HELPERS=1 -DHAS_EXCEPTION_MAGIC=0 -DHAS_PROC_WITH_BLOCK=1 -DHAS_TOP_LEVEL_ST_H=0 -DSAFE_CACHE -Wall -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -o dump.o -c dump.c
    In file included from c:/Ruby192/include/ruby-1.9.1/ruby/defines.h:205:0,
                     from c:/Ruby192/include/ruby-1.9.1/ruby/ruby.h:74,
                     from c:/Ruby192/include/ruby-1.9.1/ruby.h:32,
                     from oj.h:43,
                     from dump.c:39:
    c:/Ruby192/include/ruby-1.9.1/ruby/win32.h:272:12: error: conflicting types for 'gettimeofday'
    c:\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/time.h:39:29: note: previous declaration of 'gettimeofday' was here
    In file included from c:/Ruby192/include/ruby-1.9.1/ruby/ruby.h:1326:0,
                     from c:/Ruby192/include/ruby-1.9.1/ruby.h:32,
                     from oj.h:43,
                     from dump.c:39:
    c:/Ruby192/include/ruby-1.9.1/ruby/missing.h:42:8: error: redefinition of 'struct timezone'
    c:\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/time.h:26:8: note: originally defined here
    In file included from dump.c:39:0:
    oj.h:50:21: fatal error: pthread.h: No such file or directory
    compilation terminated.
    make: *** [dump.o] Error 1

我正在运行 Windows 7 x64、ruby 1.92、rails 3.1。

知道如何安装 oj gem 吗?谢谢

4

1 回答 1

0

OJ 的新版本修复了 Windows 问题。我安装了 OJ 1.4.3

于 2012-10-31T01:02:11.063 回答