我无法在Windows 7 64上安装oj ruby​​ gem

时间:2012-09-28 22:52:26

标签: json ruby-on-rails-3.1 gem ruby-1.9.2

我尝试安装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? 感谢

1 个答案:

答案 0 :(得分:0)

OJ的新版本解决了Windows问题。 我安装了OJ 1.4.3