Wednesday, September 1, 2010

Install sqlite3-ruby on MinGW and MSYS

(The library name "sqlite3-ruby" had been renamed to "sqlite3".)

For this instruction, we can get c-ext ruby libraries on MinGW and MSYS as We can do on Unix/Linux.

So I try to install both SQLite3 and sqlite3-ruby, of course, on MinGW and MSYS.

Install SQLite3 from source codes on MinGW and MSYS


At SQLite3 download page, I chose sqlite-amalgamation-3.7.2.tar.gz, neither sqlite-amalgamation-3.7.2.zip nor sqlite-3.7.2.zip. For MinGW and MSYS, sqlite-amalgamation-X.X.X.tar.gz is best and only source tarball.

Instrunctions on MinGW and MSYS are below:
> tar -zxvf sqlite-amalgamation-3.7.2.tar.gz
> cd sqlite-3.7.2
> ./configure --prefix=c:/sqlite3
> make
> make install

Install sqlite3-ruby on MinGW and MSYS


Next step is to install sqlite3-ruby like Ruby Devkit sample page. we must set SQLite3 dir (In this example, this is "c:/sqlite3" above).
> gem install sqlite3-ruby --platform=ruby -- --with-sqlite3-dir=c:/sqlite3
Building native extensions.  This could take a while...
Successfully installed sqlite3-ruby-1.3.1
1 gem installed
Installing ri documentation for sqlite3-ruby-1.3.1...
Installing RDoc documentation for sqlite3-ruby-1.3.1...
> gem list
minitest (1.7.0)
rake (0.8.7)
rdoc (2.5.11)
rubygems-update (1.3.7)
sqlite3-ruby (1.3.1)
test-unit (2.1.1)

You don't fotget to set "c:/sqlite3/bin" to PATH for loading libsqlite3-0.dll.

No comments:

Post a Comment