This happens because the gem makes use of some C code which needs to be compiled. Most Windows users won’t have the necessary compilers setup and therefore gem installation fails.
Rather than give yourself a migraine trying to get the gem to compile, the simple solution is to use a slightly older version of the gem (version 1.2.3 instead of the latest version 1.2.4), as this has a pre-compiled Windows binary available. To use this gem you need to specify the version on the command line like so:
gem install sqlite3-ruby -v1.2.3
MySQL gem is borked (or yet another Windows problem)
If you get this bizarre error message when you try to use MySQL in your Ruby or Rails code:
undefined method `each' for #<Mysql:0x4841af8>
…and you’re running MySQL 5.1 then you’ve hit a compatibility problem between the gem and the MySQL 5.1 client library. One solution that has been found to work is to use an older version of the client library DLL. Simply download the DLL, copy it into your Ruby installation’s bin folder, restart MySQL and normal service should resume.


4 comments
Comment on Using SQLite3 and MySQL on Windows by Luis Lavena
April 18th, 2009 @ 16:16 – permalink
Comment on Using SQLite3 and MySQL on Windows by Toni
April 30th, 2009 @ 13:34 – permalink
Comment on Using SQLite3 and MySQL on Windows by will
July 7th, 2009 @ 09:15 – permalink
Comment on Using SQLite3 and MySQL on Windows by Rob Anderton
July 25th, 2009 @ 22:59 – permalink
Leave a reply
You can use Markdown in your comment as well as plain HTML. You can use
<filter:jscode lang="ruby">and</filter:jscode>tags to surround code blocks (supported languages are css, html, javascript and ruby). Your email address will not be published.If your comment doesn’t appear immediately after posting it could have been marked as spam. Don’t worry: we regularly check for and approve incorrectly filtered comments so you shouldn’t have to wait too long for it to be shown.