

## 発生している問題

ネットに出ている情報をいろいろ試してみましたが、zipruby が入りません。  
１．`gem install zipruby`  
ネットに出ている通り

[code]

    C:\>gem install zipruby 
    Building native extensions.  This could take a while... 
    ERROR:  Error installing zipruby: 
            ERROR: Failed to build gem native extension. 
    
    C:/Ruby/bin/ruby.exe extconf.rb 
    checking for zlib.h... no 
    *** extconf.rb failed *** 
    Could not create Makefile due to some reason, probably lack of 
    necessary libraries and/or headers.  Check the mkmf.log file for more 
    details.  You may need configuration options. 
    
    Provided configuration options: 
            --with-opt-dir 
            --without-opt-dir 
            --with-opt-include 
            --without-opt-include=${opt-dir}/include 
            --with-opt-lib 
            --without-opt-lib=${opt-dir}/lib 
            --with-make-prog 
            --without-make-prog 
            --srcdir=. 
            --curdir 
            --ruby=C:/Ruby/bin/ruby 
    
    I am an extreme newbie to building C extensions, so my Googling for 
    details on the zlib library did not do me much good.  Any suggestions 
    for how to proceed? 
    
[/code]

が出力されます。

２．`gem install zipruby1.9 --platform mswin32`  
ネットで紹介されている方法ですが、

[code]

    C:\>gem install zipruby1.9 --platform mswin32
    ERROR: Could not find a valid gem 'zipruby1.9' (>= 0) in any repository
    ERROR: Possible alternatives: zipruby1.9 
    
[/code]

となり入りません。

３．`zlib.h` を入れて(zlib-1.2.3-lib.zip) `gem install zipruby`

[code]

    C:\>gem install zipruby
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing zipruby:
            ERROR: Failed to build gem native extension.
    
        current directory: C:/Ruby193/lib/ruby/gems/1.9.1/gems/zipruby-0.3.6/ext
    C:/Ruby193/bin/ruby.exe -r ./siteconf20170410-2492-i5v1a8.rb extconf.rb
    checking for zlib.h... yes
    checking for main() in -lz... yes
    checking for fseeko()... yes
    checking for ftello()... yes
    checking for mkstemp()... no
    creating Makefile
    
    current directory: C:/Ruby193/lib/ruby/gems/1.9.1/gems/zipruby-0.3.6/ext
    make  clean
    
    current directory: C:/Ruby193/lib/ruby/gems/1.9.1/gems/zipruby-0.3.6/ext
    make
    generating zipruby-i386-mingw32.def
    compiling mkstemp.c
    mkstemp.c:51:0: warning: "S_ISDIR" redefined
    c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/sta
    t.h:68:0: note: this is the location of the previous definition
    compiling tmpfile.c
    tmpfile.c: In function 'zipruby_tmpnam':
    tmpfile.c:56:3: warning: implicit declaration of function 'strcpy_s'
    tmpfile.c:62:5: warning: implicit declaration of function '_sopen_s'
    compiling zipruby.c
    compiling zipruby_archive.c
    zipruby_archive.c: In function 'zipruby_archive_get_name':
    zipruby_archive.c:407:5: warning: format '%d' expects type 'int', but argument 3
     has type 'VALUE'
    zipruby_archive.c: In function 'zipruby_archive_add_io':
    zipruby_archive.c:701:81: warning: format '%s' expects type 'char *', but argume
    nt 3 has type 'struct RString *'
    zipruby_archive.c:717:78: warning: format '%s' expects type 'char *', but argume
    nt 3 has type 'struct RString *'
    zipruby_archive.c:726:47: warning: format '%s' expects type 'char *', but argume
    nt 3 has type 'struct RString *'
    zipruby_archive.c: In function 'zipruby_archive_replace_io':
    zipruby_archive.c:780:97: warning: format '%s' expects type 'char *', but argume
    nt 4 has type 'struct RString *'
    zipruby_archive.c:789:66: warning: format '%s' expects type 'char *', but argume
    nt 4 has type 'struct RString *'
    zipruby_archive.c:796:66: warning: format '%s' expects type 'char *', but argume
    nt 4 has type 'struct RString *'
    zipruby_archive.c: In function 'zipruby_archive_read':
    zipruby_archive.c:1447:3: warning: implicit declaration of function 'fopen_s'
    zipruby_archive.c:1471:3: warning: implicit declaration of function '_fclose_nol
    ock'
    compiling zipruby_error.c
    compiling zipruby_file.c
    zipruby_file.c:13:14: warning: 'zipruby_file' declared 'static' but never define
    d
    compiling zipruby_stat.c
    compiling zipruby_zip.c
    compiling zipruby_zip_source_io.c
    compiling zipruby_zip_source_proc.c
    compiling zip_add.c
    compiling zip_add_dir.c
    compiling zip_close.c
    zip_close.c: In function 'zip_close':
    zip_close.c:146:29: warning: assignment discards qualifiers from pointer target
    type
    zip_close.c:153:6: warning: implicit declaration of function 'fseeko'
    zip_close.c:188:2: warning: implicit declaration of function 'ftello'
    zip_close.c: In function 'copy_data':
    zip_close.c:475:11: warning: comparison between signed and unsigned integer expr
    essions
    zip_close.c:475:39: warning: signed and unsigned type in conditional expression
    compiling zip_crypt.c
    zip_crypt.c:25:8: warning: return type defaults to 'int'
    zip_crypt.c: In function 'zipenc_crc32':
    zip_crypt.c:26:3: warning: pointer targets in passing argument 2 of 'crc32' diff
    er in signedness
    c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/zlib.h:
    1285:23: note: expected 'const Bytef *' but argument is of type 'char *'
    zip_crypt.c: In function 'init_keys':
    zip_crypt.c:51:17: warning: comparison between signed and unsigned integer expre
    ssions
    zip_crypt.c: In function 'decrypt_data':
    zip_crypt.c:78:17: warning: comparison between signed and unsigned integer expre
    ssions
    zip_crypt.c: In function 'copy_decrypt':
    zip_crypt.c:98:3: warning: comparison of unsigned expression < 0 is always false
    
    zip_crypt.c:109:28: warning: comparison between signed and unsigned integer expr
    essions
    zip_crypt.c:109:28: warning: signed and unsigned type in conditional expression
    zip_crypt.c: In function 'encrypt_data':
    zip_crypt.c:172:17: warning: comparison between signed and unsigned integer expr
    essions
    zip_crypt.c: In function 'copy_encrypt':
    zip_crypt.c:200:28: warning: comparison between signed and unsigned integer expr
    essions
    zip_crypt.c:200:28: warning: signed and unsigned type in conditional expression
    zip_crypt.c: In function '_zip_crypt':
    zip_crypt.c:265:5: warning: implicit declaration of function 'fseeko'
    zip_crypt.c:293:5: warning: implicit declaration of function 'ftello'
    compiling zip_delete.c
    compiling zip_dirent.c
    zip_dirent.c: In function '_zip_cdir_write':
    zip_dirent.c:109:5: warning: implicit declaration of function 'ftello'
    compiling zip_entry_free.c
    compiling zip_entry_new.c
    compiling zip_error.c
    compiling zip_error_clear.c
    compiling zip_error_get.c
    compiling zip_error_get_sys_type.c
    compiling zip_error_strerror.c
    compiling zip_error_to_str.c
    compiling zip_err_str.c
    compiling zip_fclose.c
    compiling zip_file_error_clear.c
    compiling zip_file_error_get.c
    compiling zip_file_get_offset.c
    zip_file_get_offset.c: In function '_zip_file_get_offset':
    zip_file_get_offset.c:64:5: warning: implicit declaration of function 'fseeko'
    compiling zip_file_strerror.c
    compiling zip_fopen.c
    compiling zip_fopen_index.c
    zip_fopen_index.c: In function '_zip_file_fillbuf':
    zip_fopen_index.c:155:5: warning: implicit declaration of function 'fseeko'
    compiling zip_fread.c
    compiling zip_free.c
    compiling zip_get_archive_comment.c
    compiling zip_get_file_comment.c
    compiling zip_get_name.c
    compiling zip_get_num_files.c
    compiling zip_memdup.c
    compiling zip_name_locate.c
    compiling zip_new.c
    compiling zip_open.c
    zip_open.c: In function 'zip_open':
    zip_open.c:84:5: warning: implicit declaration of function 'fseeko'
    zip_open.c:85:5: warning: implicit declaration of function 'ftello'
    compiling zip_rename.c
    compiling zip_replace.c
    compiling zip_set_archive_comment.c
    compiling zip_set_file_comment.c
    compiling zip_set_name.c
    compiling zip_source_buffer.c
    compiling zip_source_file.c
    compiling zip_source_filep.c
    zip_source_filep.c: In function 'read_file':
    zip_source_filep.c:105:2: warning: implicit declaration of function 'fseeko'
    zip_source_filep.c:115:14: warning: comparison between signed and unsigned integer expressions
    zip_source_filep.c:115:38: warning: signed and unsigned type in conditional expression
    compiling zip_source_free.c
    compiling zip_source_function.c
    compiling zip_source_zip.c
    zip_source_zip.c: In function 'read_zip':
    zip_source_zip.c:132:20: warning: comparison between signed and unsigned integer expressions
    zip_source_zip.c:132:44: warning: signed and unsigned type in conditional expression
    zip_source_zip.c:143:14: warning: comparison between signed and unsigned integer expressions
    zip_source_zip.c:143:32: warning: signed and unsigned type in conditional expression
    compiling zip_stat.c
    compiling zip_stat_index.c
    compiling zip_stat_init.c
    compiling zip_strerror.c
    compiling zip_unchange.c
    compiling zip_unchange_all.c
    compiling zip_unchange_archive.c
    compiling zip_unchange_data.c
    linking shared-object zipruby.so
    tmpfile.o: In function `zipruby_tmpnam':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/tmpfile.c:56: undefined reference to `strcpy_s'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/tmpfile.c:62: undefined reference to `_sopen_s'
    zipruby_archive.o: In function `zipruby_archive_read':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zipruby_archive.c:1447: undefined reference to `fopen_s'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zipruby_archive.c:1471: undefined reference to `_fclose_nolock'
    zip_close.o: In function `add_data':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:293: undefined reference to `ftello'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:312: undefined reference to `ftello'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:314: undefined reference to `fseeko'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:328: undefined reference to `fseeko'
    zip_close.o: In function `zip_close':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:188: undefined reference to `ftello'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_close.c:153: undefined reference to `fseeko'
    zip_crypt.o: In function `zip_crypt':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_crypt.c:293: undefined reference to `ftello'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_crypt.c:265: undefined reference to `fseeko'
    zip_dirent.o: In function `zip_cdir_write':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_dirent.c:109: undefined reference to `ftello'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_dirent.c:116: undefined reference to `ftello'
    zip_file_get_offset.o: In function `zip_file_get_offset':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_file_get_offset.c:64:undefined reference to `fseeko'
    zip_fopen_index.o: In function `zip_file_fillbuf':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_fopen_index.c:155: undefined reference to `fseeko'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_fopen_index.c:155: undefined reference to `fseeko'
    zip_open.o: In function `zip_checkcons':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:282: undefinedreference to `fseeko'
    zip_open.o: In function `zip_open':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:84: undefined reference to `fseeko'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:85: undefined reference to `ftello'
    zip_open.o: In function `zip_find_central_dir':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:436: undefinedreference to `fseeko'
    zip_open.o: In function `zip_readcdir':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:217: undefinedreference to `fseeko'
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_open.c:220: undefinedreference to `ftello'
    zip_source_filep.o: In function `read_file':
    C:\Ruby193\lib\ruby\gems\1.9.1\gems\zipruby-0.3.6\ext/zip_source_filep.c:105: undefined reference to `fseeko'
    collect2: ld returned 1 exit status
    make: *** [zipruby.so] Error 1
    
    make failed, exit code 2
    
    Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/zipruby-0
    .3.6 for inspection.
    Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/zi
    pruby-0.3.6/gem_make.out
    
[/code]

となり、やはりエラーとなります。

何方かインストールに成功されている方ご教授お願いします。

* * *

## 環境

  * OS:Windows7 x86-64
  * Ruby:1.9.3(mingw32)
  * Development Kit:4.5.2


CC BY-SA 4.0
2017-04-10T08:55:07.060
33904
2020-09-24T14:03:50.510
2019-09-18T07:20:02.933
32986
22483
question
ruby
zipruby が入りません。（Ruby 1.9.3 mingw32 に zipruby 0.3.6）


あてずっぽうですが `gem install zipruby --platform mswin32` だとどうですか？


CC BY-SA 3.0
2017-04-10T09:18:28.800
33905
2017-04-10T09:18:28.800
5008
33904
answer