Installing sqlite3 for Rails on Windows XP
Posted: April 29th, 2009 | Author: vid | Filed under: Development | Tags: ruby, ruby on rails, rubygems, sqlite | 1 Comment »Here is a short description how to install sqlite3 with RubyGems on Windows XP.
First download sqlite-3_x_x.zip and sqlitedll-3_x_x.zip from http://www.sqlite.org/download.html. Either extract the files into
<drive>:\your\path\to\ruby\bin
or set your PATH environment variable to
set PATH=C:\path\to\sqlite;%PATH%
Now, if you try to install sqlite3-ruby on Windows XP with
C:\>gem install sqlite3-ruby
and get this error message:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
c:/Programme/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
c:/Programme/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no
Then that’s because gem tries to install a sqlite3 version higher than 1.2.2 that requires some header files for compiling which are not present on your system.
Instead install sqlite3 version 1.2.2
C:\>gem install sqlite3-ruby -v=1.2.2
Now you should see this:
C:\>gem install sqlite3-ruby -v=1.2.2
Successfully installed sqlite3-ruby-1.2.2-x86-mswin32
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.2-x86-mswin32...
Installing RDoc documentation for sqlite3-ruby-1.2.2-x86-mswin32...
Successfully installed sqlite3-ruby-1.2.2-x86-mswin32
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.2-x86-mswin32...
Installing RDoc documentation for sqlite3-ruby-1.2.2-x86-mswin32...
That’s it
Thanks for show those errors i was going crazy with the fail to build =)