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:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME)
	--with-sqlcipher
	--without-sqlcipher
	--with-sqlite3-config
	--without-sqlite3-config
	--with-pkg-config
	--without-pkg-config
	--with-sqlcipher
	--without-sqlcipher
	--with-sqlite3-dir
	--without-sqlite3-dir
	--with-sqlite3-include
	--without-sqlite3-include=${sqlite3-dir}/include
	--with-sqlite3-lib
	--without-sqlite3-lib=${sqlite3-dir}/lib
	--with-pthreadlib
	--without-pthreadlib
	--with-dllib
	--without-dllib

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

  C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/mkmf.log

extconf failed, exit code 1

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

sqldiff.exe
sqlite3.exe
sqlite3_analyzer.exe
include\shell.c
include\sqlite3.c
include\sqlite3.h
include\sqlite3ext.h
lib\sqlite3.def
lib\sqlite3.dll

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…

someone?

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/