3
votes

I'm new to programming and I'm trying to install Ruby on Rails for Windows 10.

I've tried several times to run the gem install bundler but there's always an error for SQLite3.

The command prompt says to install SQLite3 from http://www.sqlite.org/ but I don't know where to place it in the directory.

I looked at the mkmf.log but I can't understand what it's telling me.

When I look in RailsInstaller's 'bin' folder sqlite3.def, sqlite 3.dll sqlite3 application and sqlite3_ruby (file and batch file) are present.

If anyone knows what might be going wrong and how to fix it I'd really appreciate some help, this problem never happens on the online how-to guides.

Many thanks

Command prompt message:

An error occurred while installing sqlite3 (1.4.0), and Bundler cannot continue. Make sure that gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/' succeeds before bundling.

In Gemfile: sqlite3

C:\Sites\test_app>gem install sqlite3 -v 1.4.0 Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing sqlite3: 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 ./siteconf20190317-7152-n0tljg.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/sqlite3-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/sqlite3-1.4.0/gem_make.ou

3
Do you really ned the newest version of sqlite? I had also problems to install Version 1.4, but version 1.3.13 worked witout problems for me.knut
Thanks for answering - it says it installed okay but when I create a new Rails file it keeps trying to install sqlite3 1.4.0 instead... 1.3.13 is in C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems, do I need to move it somewhere else?user11216582

3 Answers

4
votes

Rails tries to automatically install the latest version of the sqlite3 gem (1.4), but that new version doesn’t work with Rails yet. Specify a version that works like this:

Gemfile

gem 'sqlite3', '< 1.4'

And re-run bundle install.

1
votes

I had the same issue. Open the Gemfile that is inside your project folder and change the line gem 'sqlite3' to gem 'sqlite3', '< 1.4' like suggested by @Unixmonkey

From gem 'sqlite3' to gem 'sqlite3', '< 1.4'

0
votes
  1. don't run your code on windows
  2. if you really have to, use gem 1.3.13
gem install sqlite3 -v 1.3.13

this will not install native extensions for windows. thus won't cause any error.