title: "Invalid argument @ dir_s_mkdir" - rbczmq gem installation error on windows
body: <p>I am on windows7 with Ruby2.1.5. 
  While installing <code>rbczmq</code> i got below error: </p>
  
  <pre><code>C:\Users\namitk&gt;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 `&lt;main&gt;': 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
  </code></pre>
  
  <p>even <code>gem install rbczmq -- --with-system-libs</code> is also giving error. So above two error cases came i tried to install <code>rbczmq</code> using gem hosting service<br /></p>
  
  <p>Then i have downloaded <a href="https://github.com/methodmissing/rbczmq/archive/c371b1d5a02547fa669886d0d7650e4adfe92857.zip" rel="nofollow">source</a> from its git repo: <code>https://github.com/methodmissing/rbczmq</code>
  then i did:</p>
  
  <pre><code>git submodule init
  git submodule update
  </code></pre>
  
  <p>and from that source when i tried to build the gem from its gemspec file as <code>gem build rbczmq.gemspec</code>; same <code>uninitialized constant GNU_CHAIN</code> error came. </p>
  
  <p>then and i build the gem using system libs as below, and it was successful:</p>
  
  <pre><code>D:\rbczmq&gt;gem build rbczmq.gemspec -- --with-system-libs
  WARNING:  description and summary are identical
  WARNING:  pessimistic dependency on minitest (~&gt; 5.5.0, development) may be overly strict
    if minitest is semantically versioned, use:
      add_development_dependency 'minitest', '~&gt; 5.5', '&gt;= 5.5.0'
  WARNING:  pessimistic dependency on rake-compiler (~&gt; 0.8.0, development) may be overly strict
    if rake-compiler is semantically versioned, use:
      add_development_dependency 'rake-compiler', '~&gt; 0.8', '&gt;= 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
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>D:\rbczmq&gt;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:
  </code></pre>
  
  <p>so is there any mistake while building the gem from source? how to solve <code>Invalid argument @ dir_s_mkdir</code> error as mentioned above on windows?</p>
  
  <p>FYI: i got zeromq win64 builds for matching zeromq used in <a href="https://github.com/methodmissing/rbczmq/archive/c371b1d5a02547fa669886d0d7650e4adfe92857.zip" rel="nofollow">given rbczmq</a> from <a href="https://binstar.org/minrk/zeromq/4.0.3/download/win-64%5Czeromq-4.0.3-1.tar.bz2" rel="nofollow">https://binstar.org/minrk/zeromq/4.0.3/download/win-64%5Czeromq-4.0.3-1.tar.bz2</a> </p>