<p><strong>Update:</strong> Check out this follow-up question: <a href="https://stackoverflow.com/questions/134581/gem-update-on-windows-is-it-broken"><strong>Gem Update on Windows - is it broken?</strong></a></p>

<hr>

<p>On Windows, when I do this:</p>

<pre><code>gem install sqlite3-ruby
</code></pre>

<p>I get the following error:</p>

<pre><code>Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
        ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby --platform Win32
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no

nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.


Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
</code></pre>

<p><strong>Same thing happens with the hpricot gem</strong>. I seem to remember these gems installed just fine on &lt; 1.0 gems, but now I'm on 1.2.0, things have gone screwy.</p>

<p>I have also tried this:</p>

<pre><code>gem install sqlite3-ruby --platform Win32
</code></pre>

<p>Needless to say, this doesn't work either (same error)</p>

<p>Does anyone know what is going on here and how to fix this?</p>

<hr>

<p><strong>Update:</strong> Check out this follow-up question: <a href="https://stackoverflow.com/questions/134581/gem-update-on-windows-is-it-broken"><strong>Gem Update on Windows - is it broken?</strong></a></p>

[{'answer_id': 43804, 'author': 'Nathan Fritz', 'author_id': 4142, 'author_profile': 'https://Stackoverflow.com/users/4142', 'pm_score': 2, 'selected': False, 'text': '<p>Is it possible that the newest version has not yet been ported to Win32 yet? Since this particular gem does have bindings to compiled code, it would require a platform-specific gem. If I force installation of version 1.2.3 rather than the current 1.2.4, the platform-specific version does install, but when I allow gem to try to install the current version, I get the generic 1.2.4 version (in the gems library folder, it lacks the -x86-mswin32 suffix that the other sqlite3-ruby folders have in their names.</p>\n\n<p>Maybe someone else can answer how gem handles platform specific gems. Are separate gems uploaded for each platform and the gem software selects which one to pull down?</p>\n'}, {'answer_id': 43840, 'author': 'Charles Roper', 'author_id': 1944, 'author_profile': 'https://Stackoverflow.com/users/1944', 'pm_score': 6, 'selected': True, 'text': '<p>As Nathan suggests, this does appear to be related to the fact that the latest versions of the sqlite3-ruby and hpricot gems don\'t appear to have Windows versions. Here\'s what to do when faced with this situation (note, the name of the gem is automatically wildcarded, so you can type just <em>sql</em> and get a list of all gems beginning with <em>sql</em>):</p>\n\n<pre><code>$ gem list --remote --all sqlite\n\n*** REMOTE GEMS ***\n\nsqlite (2.0.1, 2.0.0, 1.3.1, 1.3.0, 1.2.9.1, 1.2.0, 1.1.3, 1.1.2, 1.1.1, 1.1)\nsqlite-ruby (2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.1.0, 2.0.3, 2.0.2)\nsqlite3-ruby (1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.0, 1.0.1, 1.0.0, 0.9.0, 0.6.0, 0.5.0)\n</code></pre>\n\n<p>Then you can choose the version you would like to install:</p>\n\n<pre><code>gem install sqlite3-ruby -v 1.2.3\n</code></pre>\n\n<p>To successfully install hpricot, I did this:</p>\n\n<pre><code>gem install hpricot -v 0.6\n</code></pre>\n\n<p>Annoyingly, doing a <strong><code>gem update</code></strong> tries to update the gems to their latest, broken-on-Windows, versions. When the update routine encounters an error, it ditches you out of the whole process. There\'s a (hacky) solution to this problem <strong><a href="https://stackoverflow.com/questions/134581/gem-update-on-windows-is-it-broken">here</a></strong>.</p>\n\n<p><strong>So, is this issue a bug in gems? Should gems not automatically detect the platform and install the latest compatible version?</strong></p>\n'}, {'answer_id': 366757, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>I also ran into this problem.  It\'s worth knowing that the difference between 1.2.3 and 1.2.4 is not significant.   Here are the 1.2.4. release notes:</p>\n\n<blockquote>\n  <p><strong>Release Name: 1.2.4</strong></p>\n  \n  <p>Notes: This release only updates the\n  generated C file to reflect the\n  compatibility changes that were made\n  to the SWIG file. Binary builds (e.g.,\n  Windows) are not affected, and need no\n  update. In general, you will not need\n  this update unless you are using a\n  version of Ruby prior to 1.8.6.\n  (source: <a href="http://rubyforge.org/frs/shownotes.php?release_id=25302" rel="nofollow noreferrer" title="rubforge release notes on 1.2.4">1.2.4. release notes</a>)</p>\n</blockquote>\n\n<p>Hope that helps others!</p>\n'}, {'answer_id': 476596, 'author': 'Mercurious', 'author_id': 36858, 'author_profile': 'https://Stackoverflow.com/users/36858', 'pm_score': 3, 'selected': False, 'text': '<p>I had the same problem on Ubuntu, this solved the problem for me:</p>\n\n<p><a href="http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.ruby/2008-08/msg00339.html" rel="nofollow noreferrer">http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.ruby/2008-08/msg00339.html</a></p>\n'}, {'answer_id': 1940647, 'author': 'taonet', 'author_id': 236108, 'author_profile': 'https://Stackoverflow.com/users/236108', 'pm_score': 1, 'selected': False, 'text': '<p>I had the same problem on Windows and I have installe  MinGW \n<a href="http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/download" rel="nofollow noreferrer">http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/download</a>\nand the problem has gone :-)</p>\n\n<p>C:>gem install hpricot\nSuccessfully installed hpricot-0.8.2-x86-mswin32\n1 gem installed\nInstalling ri documentation for hpricot-0.8.2-x86-mswin32...\nInstalling RDoc documentation for hpricot-0.8.2-x86-mswin32...</p>\n\n<p>C:>gem install ruby-postgres\nSuccessfully installed ruby-postgres-0.7.1.2006.04.06-x86-mswin32\n1 gem installed\nInstalling ri documentation for ruby-postgres-0.7.1.2006.04.06-x86-mswin32...\nInstalling RDoc documentation for ruby-postgres-0.7.1.2006.04.06-x86-mswin32...</p>\n'}, {'answer_id': 17907570, 'author': 'jiahut', 'author_id': 1517100, 'author_profile': 'https://Stackoverflow.com/users/1517100', 'pm_score': 2, 'selected': False, 'text': '<p>first from sqlite.org(<a href="http://www.sqlite.org/download.html" rel="nofollow">http://www.sqlite.org/download.html</a>)<br>\ndownload -><br>\n    Precompiled Binaries: <code>sqlite-dll-win32-x86-3071700.zip</code><br>\n    and Source Code: <code>sqlite-autoconf-3071700.tar.gz</code><br>\n    then extract as:</p>\n\n<pre><code>-include\n    --sqlite3.h\n    --sqlite3ext.h\n-lib\n    --shell.c\n    --sqlite3.c\n    --sqlite3.def\n    --sqlite3.dll\n</code></pre>\n\n<p>last install gem like:</p>\n\n<pre><code>gem install sqlite3 --platform=ruby -- --with-sqlite3-include=path\\to\\include  \n --with-sqlite3-lib=path\\to\\lib --no-ri --no-rdoc\n</code></pre>\n\n<p>Good luck!</p>\n'}]
['https://Stackoverflow.com/questions/43778', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1944/']