title: Can't install Nokogiri for Ruby in Windows
body: <p>I know this is simple but I just can't figure it out. I need to run a script in Ruby and it requires Nokogiri. I do have some experience in other languages but not in Ruby.</p>
  <p>Here is my system :</p>
  <blockquote>
  <p>Ruby 2.0.0-p195 (x64) is installed @ <em>C:\Programs\RubyLanguage</em></p>
  <p>Ruby Development Kit (mingw64-64-4.7.2-20130224-1432) is installed @ <em>C:\Programs\RubyDevKit</em></p>
  </blockquote>
  <p>When I run <code>gem install nokogiri</code> I get this error:</p>
  <pre><code>    ERROR:  Error installing nokogiri:
          The 'nokogiri' native gem requires installed build tools.
  
  Please update your PATH to include build tools or download the DevKit
  from 'http://rubyinstaller.org/downloads' and follow the instructions
  at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
  </code></pre>
  <p>Easy enough. So I followed <a href="http://github.com/oneclick/rubyinstaller/wiki/Development-Kit" rel="nofollow noreferrer">the link of above</a> and did to step 3. However step 4 says generate &quot;config.yml&quot;. So I did. Now the file is an empty list with some comments. I still can't install Nokogiri because of error above and I don't seem to get anywhere with DevKit . What I am saying is that the steps in the Development Kit installation is not clear enough for me.</p>
  <hr />
  <p><strong>Update</strong> it now says installation of Nokogiri failed ( DevKit Works according to step 5 : Installing documentation for json-1.8.0
  1 gem installed )</p>
  <pre><code>mkmf.log: package configuration for libxslt is not found
  package configuration for libxml-2.0 is not found
  package configuration for libiconv is not found
  find_header: checking for libxml/parser.h... -------------------- no
  
  &quot;x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Programs/RubyLanguage/include/ruby-2.0.0/x64-mingw32 -IC:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/backward -IC:/Programs/RubyLanguage/include/ruby-2.0.0 -I. -IC:/Programs/RubyLanguage/include/libxml2 -IC:/Programs/RubyLanguage/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -DXP_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c  -L. -LC:/Programs/RubyLanguage/lib -LC:/Programs/RubyLanguage/lib -L.      -lx64-msvcrt-ruby200  -lshell32 -lws2_32 -limagehlp -lshlwapi   &quot;
  In file included from C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/defines.h:153:0,
                   from C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/ruby.h:70,
                   from C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby.h:33,
                   from conftest.c:1:
  C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/win32.h: In function 'rb_w32_pow':
  C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/win32.h:776:16: warning: conversion to 'double' from 'long double' may alter its value [-Wconversion]
  In file included from C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby.h:33:0,
                   from conftest.c:1:
  C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/ruby.h: In function 'rb_float_value':
  C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/ruby.h:777:6: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion]
  C:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/ruby.h:777:6: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion]
  checked program was:
  /* begin */
  1: #include &quot;ruby.h&quot;
  2: 
  3: #include &lt;winsock2.h&gt;
  4: #include &lt;windows.h&gt;
  5: int main(int argc, char **argv)
  6: {
  7:   return 0;
  8: }
  /* end */
  
  &quot;x86_64-w64-mingw32-gcc -E -IC:/Programs/RubyLanguage/include/ruby-2.0.0/x64-mingw32 -IC:/Programs/RubyLanguage/include/ruby-2.0.0/ruby/backward -IC:/Programs/RubyLanguage/include/ruby-2.0.0 -I. -IC:/Programs/RubyLanguage/include/libxml2 -IC:/Programs/RubyLanguage/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -DXP_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline  conftest.c -o conftest.i&quot;
  conftest.c:5:27: fatal error: libxml/parser.h: No such file or directory
  compilation terminated.
  checked program was:
  /* begin */
  1: #include &quot;ruby.h&quot;
  2: 
  3: #include &lt;winsock2.h&gt;
  4: #include &lt;windows.h&gt;
  5: #include &lt;libxml/parser.h&gt;
  /* end */
  </code></pre>
  <p><strong>CMD log</strong></p>
  <pre><code>Microsoft Windows [Version 6.1.7601]
  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
  
  C:\Users\SEPEHR&gt;gem install nokogiri
  Temporarily enhancing PATH to include DevKit...
  Building native extensions.  This could take a while...
  ERROR:  Error installing nokogiri:
          ERROR: Failed to build gem native extension.
  
      C:/Programs/RubyLanguage/bin/ruby.exe extconf.rb
  checking for libxml/parser.h... no
  -----
  libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokog
  iri.html for help with installing dependencies.
  -----
  *** 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:/Programs/RubyLanguage/bin/ruby
          --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-iconv-dir
          --without-iconv-dir
          --with-iconv-include
          --without-iconv-include=${iconv-dir}/include
          --with-iconv-lib
          --without-iconv-lib=${iconv-dir}/lib
          --with-xml2-dir
          --without-xml2-dir
          --with-xml2-include
          --without-xml2-include=${xml2-dir}/include
          --with-xml2-lib
          --without-xml2-lib=${xml2-dir}/lib
          --with-xslt-dir
          --without-xslt-dir
          --with-xslt-include
          --without-xslt-include=${xslt-dir}/include
          --with-xslt-lib
          --without-xslt-lib=${xslt-dir}/lib
          --with-libxslt-config
          --without-libxslt-config
          --with-pkg-config
          --without-pkg-config
          --with-libxml-2.0-config
          --without-libxml-2.0-config
          --with-pkg-config
          --without-pkg-config
          --with-libiconv-config
          --without-libiconv-config
          --with-pkg-config
          --without-pkg-config
  
  
  Gem files will remain installed in C:/Programs/RubyLanguage/lib/ruby/gems/2.0.0/
  gems/nokogiri-1.6.0 for inspection.
  Results logged to C:/Programs/RubyLanguage/lib/ruby/gems/2.0.0/gems/nokogiri-1.6
  .0/ext/nokogiri/gem_make.out
  </code></pre>