ruby / zlib

Ruby interface for the zlib compression/decompression library
Other
49 stars 35 forks source link

Unable to install this gem on windows #47

Closed enumag closed 1 year ago

enumag commented 2 years ago
$ gem install zlib
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing zlib:
        ERROR: Failed to build gem native extension.

    current directory: C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/zlib-2.1.1/ext/zlib
C:/Program\ Files/Ruby31-x64/bin/ruby.exe -I C:/Program\ Files/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220412-23292-w9lkku.rb extconf.rb
checking for deflateReset() in -lz... *** 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:/Program Files/Ruby31-x64/bin/$(RUBY_BASE_NAME)
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-z-dir
        --without-z-dir
        --with-z-include
        --without-z-include=${z-dir}/include
        --with-z-lib
        --without-z-lib=${z-dir}/lib
        --with-zlib
        --without-zlib
C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:591:in `try_link0'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:609:in `try_link'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:830:in `try_func'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1065:in `block in have_library'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1007:in `block in checking_for'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in postpone'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:332:in `open'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:332:in `open'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:358:in `postpone'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1006:in `checking_for'
        from C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1060:in `have_library'
        from extconf.rb:14:in `block in <main>'
        from extconf.rb:14:in `each'
        from extconf.rb:14:in `find'
        from extconf.rb:14:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/zlib-2.1.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/zlib-2.1.1 for inspection.
Results logged to C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/zlib-2.1.1/gem_make.out

The log files mentioned in the output are attached.

zlib-2.1.1.zip

nobu commented 1 year ago

C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.