Installing sqlite3 fails

Apr18
  • Share/Bookmark

Difficulty: ★☆☆☆☆

Ajj. Working with Ruby and the gem for installing sqlite database fails.
I tried to download sqlite3, and run the install gem command:

D:\>gem install sqlite3-ruby

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 Win32checking for fdatasync() in rt.lib... nochecking for sqlite3.h... nonmake'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

This is because not all versions of sqlite3 are windows versions.
Fine, and now?
You can list all available sqlite gems:

D:\>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)
sqlitecache (0.0.1)

Then, you can easily install the version you need:

D:\>gem install sqlite3-ruby -v 1.2.3
Successfully installed sqlite3-ruby-1.2.3-x86-mswin32
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.3-x86-mswin32...
Installing RDoc documentation for sqlite3-ruby-1.2.3-x86-mswin32...


Leave a comment