title: ERROR: Error installing mysql: ERROR: Failed to build gem native extension
body: <p>I followed the "<a href="http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/" rel="nofollow">http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/</a>" for setting the connection between Ruby on rails app and mysql server 5.1</p>
  
  <p>So when I install the mysql gem with the following command:</p>
  
  <pre><code>gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
  </code></pre>
  
  <p>So I'm getting the following error log:</p>
  
  <blockquote>
    <p>Temporarily enhancing PATH to include DevKit...<br>
    Building native extensions.  This could take a while...<br>
    ERROR:  Error installing mysql:<br>
            ERROR: Failed to build gem native extension.  </p>
  
  <pre><code>   C:/Ruby187/bin/ruby.exe extconf.rb --with-mysql-dir=C:/mysql-connector-c
  </code></pre>
    
    <p>-noinstall-6.0.2-win32
    checking for main() in -llibmysql... no
    <strong>* extconf.rb failed *</strong>
    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.</p>
    
    <p>Provided configuration options:<br>
            --with-opt-dir<br>
            --without-opt-dir<br>
            --with-opt-include<br>
            --without-opt-include=${opt-dir}/include<br>
            --with-opt-lib<br>
            --without-opt-lib=${opt-dir}/lib<br>
            --with-make-prog<br>
            --without-make-prog<br>
            --srcdir=.<br>
            --curdir<br>
            --ruby=C:/Ruby187/bin/ruby<br>
            --with-mysql-dir<br>
            --with-mysql-include<br>
            --without-mysql-include=${mysql-dir}/include<br>
            --with-mysql-lib<br>
            --without-mysql-lib=${mysql-dir}/lib<br>
            --with-libmysqllib<br>
            --without-libmysqllib  </p>
    
    <p>Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/mysql-2.9.1
     for inspection.
    Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/mysql-2.9.1/ext/mysql_api/ge
    m_make.out</p>
  </blockquote>
  
  <p>Extra Info:
  Ruby version 1.8.7
  Windows 7 64 bit
  Mysql version 5.1</p>