"Invalid argument @ dir_s_mkdir" - rbczmq gem installation error on windows

1.1k views Asked by At

I am on windows7 with Ruby2.1.5. While installing rbczmq i got below error:

C:\Users\namitk>gem install rbczmq
Building native extensions.  This could take a while...
ERROR:  Error installing rbczmq:
        ERROR: Failed to build gem native extension.

    C:/Ruby21-x64/bin/ruby.exe extconf.rb
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
*** 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:/Ruby21-x64/bin/ruby
        --with-kernel32lib
        --without-kernel32lib
        --with-rpcrt4lib
        --without-rpcrt4lib
        --with-gdi32lib
        --without-gdi32lib
extconf.rb:49:in `<main>': uninitialized constant GNU_CHAIN (NameError)

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rbczmq-1.7.8 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/rbczmq-1.7.8/gem_make.out

even gem install rbczmq -- --with-system-libs is also giving error. So above two error cases came i tried to install rbczmq using gem hosting service

Then i have downloaded source from its git repo: https://github.com/methodmissing/rbczmq then i did:

git submodule init
git submodule update

and from that source when i tried to build the gem from its gemspec file as gem build rbczmq.gemspec; same uninitialized constant GNU_CHAIN error came.

then and i build the gem using system libs as below, and it was successful:

D:\rbczmq>gem build rbczmq.gemspec -- --with-system-libs
WARNING:  description and summary are identical
WARNING:  pessimistic dependency on minitest (~> 5.5.0, development) may be overly strict
  if minitest is semantically versioned, use:
    add_development_dependency 'minitest', '~> 5.5', '>= 5.5.0'
WARNING:  pessimistic dependency on rake-compiler (~> 0.8.0, development) may be overly strict
  if rake-compiler is semantically versioned, use:
    add_development_dependency 'rake-compiler', '~> 0.8', '>= 0.8.0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: rbczmq
  Version: 1.7.8
  File: rbczmq-1.7.8.gem

as you can see above step is successful when i build gem from source on windows. But error comes when i install this gem as:

D:\rbczmq>gem install rbczmq-1.7.8.gem
ERROR:  While executing gem ... (Errno::EINVAL)
    Invalid argument @ dir_s_mkdir - C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rbczmq-1.7.8/d:

so is there any mistake while building the gem from source? how to solve Invalid argument @ dir_s_mkdir error as mentioned above on windows?

FYI: i got zeromq win64 builds for matching zeromq used in given rbczmq from https://binstar.org/minrk/zeromq/4.0.3/download/win-64%5Czeromq-4.0.3-1.tar.bz2

0

There are 0 answers