Sqlite installation


#1

I think I installed sqlite properly but when I put the command gem install sqlite3 i get this

C:\sqlite\sqlite3>gem install sqlite3
Temporarily enhancing PATH for MSYS/MINGW…
Installing required msys2 packages: mingw-w64-x86_64-sqlite3
error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
if you’re sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck
pacman failed with the following output:
Building native extensions. This could take a while…
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.0/ext/sqlite3

C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20190204-7288-4n43be.rb extconf.rb
checking for sqlite3.h… no
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
*** 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:/Ruby25-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

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

C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/sqlite3-1.4.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.0 for inspection.
Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/sqlite3-1.4.0/gem_make.out


#2

The first line:

C:\sqlite\sqlite3>gem install sqlite3

already let’s us know that you downloaded the sqlite3’s precompiled binaries for Windows from the download page:

https://www.sqlite.org/download.html

correct?

If that is true, then you have to run this command:

gem install sqlite3 --platform=ruby – --with-sqlite3-include=[path\to\sqlite3.h] --with-sqlite3-lib=[path\to\sqlite3.o]

from where you the downloaded the sqlite source:

((wild guess)) $ gem install sqlite3 --platform=ruby – --with-sqlite3-include=c:/sqlite/sqlite3 --with-sqlite3-lib=c:/sqlite/sqlite3/.libs/

from inside the MINGW32 terminal, not the cmd prompt window nor powershell

Here is the detailed list from where I grabbed the solution:

Let me know if you need any more help.


#3

Running that command did not work