I'm new to ruby on rails, having a problem with installing sqlite3 -v 1.4.0
each time I run bundle install
and am not able to start rails server because of this.
I am on windows 7
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 ./siteconf20190428-4968-1wrdwr0.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
c:\Sites\blog>
Your error contains a recommendation inside it:
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first
sqlite3 gem is only a wrapper around it, you need SQLite in your system to compile and install it.
type ridk exec pacman -S mingw-w64-x86_64-dlfcn in command line, install this, and try again
Related
I am trying to get into Ruby on Rails. I have followed this: http://installrails.com/steps/create_your_first_app
But when I type rails new sample_app I get this error:
current directory:
c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/sqlite3-1.4.1/ext/sqlite3
c:/RailsInstaller/Ruby2.3.3/bin/ruby.exe -r ./siteconf20190630-14364-17waap6.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.1/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.1 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.1/gem_make.out
An error occurred while installing sqlite3 (1.4.1), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.1'` succeeds before bundling.
In Gemfile:
sqlite3
But if I then runs the gem install sqlite3 -v '1.4.1' line, I get this message, which looks like a success.
gem install sqlite3
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-x86_64-sqlite3
advarsel: mingw-w64-x86_64-sqlite3-3.27.2-2 er opdateret - springer over
Building native extensions. This could take a while...
Successfully installed sqlite3-1.4.1
Parsing documentation for sqlite3-1.4.1
Done installing documentation for sqlite3 after 2 seconds
1 gem installed
But I still can't create a new project.
Any Ideas?
Execute below commands it may help to you
ridk exec pacman -S mingw-w64-x86_64-sqlite3
ridk exec pacman -S mingw-w64-x86_64-dlfcn
gem install sqlite3
bundle install
When tried to create a new rails application and once i create and ran the bundle install, got this error in my console.
Fetching sqlite3 1.4.0
Installing sqlite3 1.4.0 with native extensions
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 ./siteconf20190424-9316-5yovlr.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
You will need to install sqlite3 first. This will ensure that you have the all the files needed to compile against. It's right there in the error message:
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
This should help you!
Try to replace your gem 'sqlite3' on this one
Gemfile
gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"
I am trying to do a new ruby on rails, everything goes perfectly until it want to install sqlite3 - I do have it installed and it is recognised when asking it in cmd, but the error asks for a different version. Tried to install that version, but no success.
I tried many other things from the internet, but just can't make it work.
I am a newbie trying to learn.
Installing sqlite3 1.4.0 with native extensions
Gem::Ext::BuildError: 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 ./siteconf20190308-12720-15tc5du.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:/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
--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:/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
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
installing the required version
gem install sqlite3 -v 1.4.0
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-x86_64-sqlite3
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 ./siteconf20190308-5276-1djiqig.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:/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
--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:/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
Seems like some issues with new sqlite 1.4.0 gem.
https://github.com/rails/rails/issues/35153
Use this version instead.
gem 'sqlite3', '~> 1.3.6'
Thank you all.
After all I followed Max's proposal I changed to postgres and is working perfectly.
I keep getting the below error in rails on windows when I try to make a new rails app? It fails when it gets to installing sqlite3.
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 ./siteconf20190220-14164-174xy0j.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:/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
--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:/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
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.
I have sqlite3 installed on my machine and I am using windows 10. I have attempted ot run the gem install sqlite3 command like it prompts me to but it still fails what am I doing wrong?
Try this
$ sudo apt-get install libsqlite3-dev
then,
$ bundle install
Probably, you use different rails version.
Solution is change version of sqlite to 1.3.6:
gem 'sqlite3', '~> 1.3.6'
After this change run command:
bundle update
Hi I got the same message when tried to install SQLite gem without MinGW gem installed already
C:\Sites>ridk exec pacman -S mingw-w64-x86_64-dlfcn
Install it and try again
If you DON'T have installed RailsInstaller only Ruby DevKit it should work. If not please try uninstalling it first, removing the remaining folders and installing rails by command gem install rails
Try uninstalling all the versions of the sqlite3 gem from the system and reinstalling only version 1.4.0
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
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
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.