sqlite3-ruby gem: Failed to build gem native extension

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 sql and get a list of all gems beginning with sql):

$ gem list --remote --all sqlite

*** REMOTE GEMS ***

sqlite (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)
sqlite-ruby (2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.1.0, 2.0.3, 2.0.2)
sqlite3-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)

Then you can choose the version you would like to install:

gem install sqlite3-ruby -v 1.2.3

To successfully install hpricot, I did this:

gem install hpricot -v 0.6

Annoyingly, doing a gem update 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 here.

So, is this issue a bug in gems? Should gems not automatically detect the platform and install the latest compatible version?

Leave a Comment