SqliIte3 error when starting rails server on Windows

In my previous post, I made it sound like the Rails installation was painless, and it was apart from one point. When starting ‘rails server’, it complained that it couldn’t find sqlite3-ruby. I would have expected this to be installed as part of the rails gem, but it’s a simple installation anyway:

gem install sqlite3-ruby

However, when attempting to start the server again, I received the following message dialog.

ruby.exe – System Error
The program can’t start because sqlite3.dll is missing from your computer. Try reinstalling the program to fix this problem.

With the stacktrace of:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.1-x86-mingw32/lib/sqlite3.rb:6:in `require’: no such file to load –
– sqlite3/sqlite3_native (LoadError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.1-x86-mingw32/lib/sqlite3.rb:6:in `rescue in uired)>’
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.1-x86-mingw32/lib/sqlite3.rb:2:in `
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require’
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `block (2 levels) in require

To solve the problem (and considering this is only my local dev machine) I downloaded sqlite3.dll from http://www.sqlite.org/sqlitedll-3_7_2.zip. I then copied the two files into C:WindowsSystem32. 

I could then happily execute rails server. Admitted, not the best way but it was the quickest 🙂

One thought on “SqliIte3 error when starting rails server on Windows”

Leave a Reply

Your email address will not be published. Required fields are marked *