I'm very new to Ruby etc so please consider this in any replies :D
I'm trying to install Rails on my PC and I'm being hit with the above error.
There is another answer to this question (error installing sqlite3 Public Keyring not found) but after working out how to install the mingw64 shell and resetting the pacman keystore, I'm still getting the same error.
Here's where it all went wrong:
Installing sqlite3 1.4.2 with native extensionswarning: Public keyring not found; have you run 'pacman-key --init'?error: mingw32: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: mingw64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: ucrt64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: clang64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: msys: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: database 'mingw32' is not valid (invalid or corrupted database (PGP signature))error: database 'mingw64' is not valid (invalid or corrupted database (PGP signature))error: database 'ucrt64' is not valid (invalid or corrupted database (PGP signature))error: database 'clang64' is not valid (invalid or corrupted database (PGP signature))error: database 'msys' is not valid (invalid or corrupted database (PGP signature))Gem::Ext::BuildError: ERROR: Failed to build gem native extension.current directory:C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sqlite3-1.4.2/ext/sqlite3C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r./siteconf20211116-149712-azfuy1.rb extconf.rbchecking for sqlite3.h... nosqlite3.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 necessarylibraries and/or headers. Check the mkmf.log file for more details. You mayneed 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:/Ruby30-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}/libTo see why this extension failed to compile, please check the mkmf.log which canbe found here:C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/sqlite3-1.4.2/mkmf.logextconf failed, exit code 1
And here is the mkmf.log
"pkg-config --exists sqlite3"package configuration for sqlite3 is not foundfind_header: checking for sqlite3.h... -------------------- no"gcc -o conftest.exe -IC:/Ruby30-x64/include/ruby-3.0.0/x64-mingw32 -IC:/Ruby30-x64/include/ruby-3.0.0/ruby/backward -IC:/Ruby30-x64/include/ruby-3.0.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30-x64/lib -L. -pipe -s -fstack-protector-strong -m64 -lx64-msvcrt-ruby300 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "checked program was:/* begin */1: #include "ruby.h"2: 3: #include <winsock2.h>4: #include <windows.h>5: int main(int argc, char **argv)6: {7: return !!argv[argc];8: }/* end */"gcc -E -IC:/Ruby30-x64/include/ruby-3.0.0/x64-mingw32 -IC:/Ruby30-x64/include/ruby-3.0.0/ruby/backward -IC:/Ruby30-x64/include/ruby-3.0.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"conftest.c:5:10: fatal error: sqlite3.h: No such file or directory5 | #include <sqlite3.h>| ^~~~~~~~~~~compilation terminated.checked program was:/* begin */1: #include "ruby.h"2: 3: #include <winsock2.h>4: #include <windows.h>5: #include <sqlite3.h>/* end */--------------------
And this is the version of sqlite3 on my computer
sqlite3 --version3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88alt2
Any help would be greatly appreciated
Best Answer
This answer worked for me
error installing sqlite3 Public Keyring not found
I got below error
warning: Public keyring not found; have you run 'pacman-key --init'?error: mingw32: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: mingw64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: ucrt64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: clang64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: msys: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknownerror: keyring is not writableerror: database 'mingw32' is not valid (invalid or corrupted database (PGP signature))error: database 'mingw64' is not valid (invalid or corrupted database (PGP signature))error: database 'ucrt64' is not valid (invalid or corrupted database (PGP signature))error: database 'clang64' is not valid (invalid or corrupted database (PGP signature))error: database 'msys' is not valid (invalid or corrupted database (PGP signature))Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
I ran below command in mingw64(MSYS2 MINGW64 shell launcher). In mine, I found inside C:\Ruby31-x64\msys64.
rm -r /etc/pacman.d/gnupg/
pacman-key --init
pacman-key --populate msys2
After this , I ran
bundle install
in project path. It worked for me.