My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://kavachai.com
and update your bookmarks.

Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Tuesday, February 3, 2009

Getting Ruby on Rails 2.2.2 working on Windows XP

When installing Rails 2.2.2 I ancountered a problem with sqlite3. Although sqlite3 is a default database used by Rails starting from version 2.2.2 on Windows XP is not such a trivial thing to make it work.

I started by trying to install sqlite3 using gem like this:
gem install sqlite3-ruby
But I got an error:
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

C:/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no

nmake

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

NMAKE : fatal error U1073: don't know how to make 'ruby.h'
Stop.
The solution is quite strange from my point of view:
  1. Download sqlite and sqlitedll from sqlite downloads (by now they are "sqlite-3_6_10.zip" and "sqlitedll-3_6_10.zip").

  2. Unzip both archives to Ruby bin folder ("C:\ruby\bin" on my machine). There should be three files: sqlite3.exe, sqlite3.dll and sqlite3.def.

  3. Install sqlite-ruby using such a command:
    gem install sqlite3-ruby --version 1.2.3
The strange thing is that if you do not use the version parameter installation will be unsuccessfull.