Reputation: 9
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/sqlite3-1.4.0/ext/sqlite3 C:/RailsInstaller/Ruby2.3.3/bin/ruby.exe -r ./siteconf20190220-5856-12t9mtl.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:/RailsInstaller/Ruby2.3.3/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:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/sql ite3-1.4.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/sqlite3-1.4.0 for inspection. Results logged to C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/sql ite3-1.4.0/gem_make.out
An error occurred while installing sqlite3 (1.4.0), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.4.0'
succeeds before bundling.
In Gemfile: sqlite3
Upvotes: 0
Views: 234
Reputation: 36
I have got the same issue and tried for more than a week a lot of solutions the only one worked for me was uninstall RailsInstaller only install Ruby DevKit (make sure all the folders of RailsInstaller installation are gone or you'll see a message "C:/RailsInstaller/Ruby2.3.3/bin" cannot be found when trying to use gem command) install rails by command line C:/Sites > gem install rails
and install MinGW
C:\Sites>ridk exec pacman -S mingw-w64-x86_64-dlfcn
Download the SQLite3 gem from https://rubygems.org/, save it locally and install it from file
C:\Sites>gem install --local C:\sqlite3-1.4.0.gem
The good thing is it worked for all the projects that I created after.
Upvotes: 0
Reputation: 1097
Probably, you use rails in 5.2.2 version. Solution is change version of sqlite
to 1.3.6
:
gem 'sqlite3', '~> 1.3.6'
After this change run command:
bundle update
Upvotes: 0