views:

22

answers:

1

I have first to explain a little bit my context, then the question:

  1. I have used Ruby on Rails now for 3 years with different applications, and upgraded from 1.2 up to 2.3.9. I want to upgrade to 3.0.0 as fast as possible.
  2. All I have read about it told to use the current version 1.9.2 of Ruby to work with Rails 3.0.0, so I installed the precompiled binary 1.9.2 on Windows.
  3. I remembered that sqlite3 needs the DLL installed somewhere in the path, so I copied it over to the new bin directory.
  4. I installed the necessary sqlite3-ruby as well.
  5. I created a new application, generated a dummy table migration, and tried to do 'rake db:migrate'
  6. The answer was: rake aborted! no driver for sqlite3 found

I searched around and found some answers, that told to install the binary for sqlite3 by yourself (which is out of reach for me).

So here is the question:

What is the right setup to use Rails 3.0.0 on Ruby 1.9.2 on Windows?

By the way, when installing just sqlite3-ruby, I got a newer version (1.3.1) that seemed to work. But when I wanted to use that in rails, rails insisted to install the version 1.2.5 (which obviously doesn't work for me).

A: 

Well, I know it is bad style, but I found one solution for me. I don't know why it did not work in the first place ...

The solution for me was:

  1. Install the latest version of sqlite3-ruby (currently version 1.3.1)

  2. That installation gives you (as text in the DOS shell) the information where to copy the correct sqlite3.dll. Ensure to copy that one in the bin directory of Ruby (or anywhere else on your path).

  3. Ensure that your Gemfile (app-root/Gemfile) list the requirement:

    gem 'sqlite3-ruby', ">= 1.3.1", :require => 'sqlite3'

  4. Do a 'rake db:migrate' now (which should work then).

I did not find the reason why Rails 3.0.0 insisted to install version sqlite3-ruby 1.2.5, but with that version installed, sqlite3 did not work for me.

mliebelt