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.