Having problems in installing sqlite3 in Windows 10

I am very new to ruby and rails. I am trying to install to sqlite3 for trying a tutorial and having issues. I am on Windows 10 and using ruby 2.6.1p33 (2019-01-30 revision 66950) [x64-mingw32].
here is the installation error I am getting while running gem install sqlite3-ruby. I have also tried running gem install sqlite3 --platform=ruby -- --with-sqlite3-include=c:/sqlite3/include --with-sqlite3-lib=c:/sqlite3/lib

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0/ext/sqlite3
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190217-3116-1d59gcv.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... no
checking for dlopen()... no
missing function dlopen
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:

To see why this extension failed to compile, please check the mkmf.log which can be found here:


extconf failed, exit code 1

I have downloaded sqlite3 from their site and here is the folder structure of C:\sqlite3\


I have also copied sqldiff.exe, sqlite3.exe and sqlite3_analyzer.exe to C:\Ruby26-x64\bin
In my environment variable, I have added C:\sqlite3\ to PATH and also created a new environment variable sqlite3-dir pointing to C:\sqlite3\

Could someone please provide some help for this installation problem?

1 Like

same situation here. (Win10 32bit)
also tried on Win7 (32 Bit),

sqlite3 problems.
cant figure it out.
did all steps by the book :

  1. Getting Started with Rails — Ruby on Rails Guides
  2. Install Rails | Your Guide for Installing Ruby on Rails

with no success,
seems like there were always problem install on windows , and nothing had change…


If you are using msys2 try install the follow dependency with

$ pacman -S mingw-w64-x86_64-dlfcn

Then install sqlite3 with

$ gem install sqlite3 -- --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib/