Trying to build Ruby on Rails applications in Windows can be a pain because most Rails developers use Macs.  I am one of the few developers that doesn’t own a Mac and I use Windows.  I ran into this problem for a long time and I decided that once I found the solution, I would share it with the world.

After installing Ruby 1.9.2, installing Rails, running “bundle install”, “gem install sqlite3″ and creating a new application, I tried to run the application through Netbeans and received the following message:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require’: no such file to load — sqlite3/sqlite3_native (LoadError)

Trying to start WEBrick from the command line resulted in the following error message:

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

I read in several places online that to fix this issue, I had to download sqlite3.dll and place it somewhere in my Windows path.  I downloaded the latest version from the www.sqlite.org and placed it in my C:/Ruby192/bin directory.  When I tried to run the application again, I received the following error message:

The procedure entry point sqlite3_column_database_name could not be located in the dynamic link library sqlite3.dll.

This is basically telling you that you have the wrong version of sqlite3.dll.  I finally fixed both of these issues by paying attention (imagine that) to the message I received when I performed “gem install sqlite3″.  It tells you exactly where to find the correct version of sqlite3.dll on the www.sqlite.org website.  I downloaded the version (seen below) and placed it in C:/Ruby192/bin and then the application ran correctly.

sqlite3 terminal

I hope this helps other Windows users that might be experiencing the same problem.  I know it drove me crazy!

Comments

Powered by Facebook Comments