Unable to install sqlite gem


#1

I was trying to install rails but my app doesn’t install sqlite3 germ, I was trying to install it manieally using bundle install but still nothing happens, heeelp please here is my terminal:

 rails new app1
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
      create  
      create  README.md
      create  Rakefile
      create  .ruby-version
      create  config.ru
      create  .gitignore
      create  Gemfile
         run  git init from "."
Initialized empty Git repository in /home/henzy/odin3/app1/.git/
      create  package.json
      create  app
      create  app/assets/config/manifest.js
      create  app/assets/javascripts/application.js
      create  app/assets/javascripts/cable.js
      create  app/assets/stylesheets/application.css
      create  app/channels/application_cable/channel.rb
      create  app/channels/application_cable/connection.rb
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/jobs/application_job.rb
      create  app/mailers/application_mailer.rb
      create  app/models/application_record.rb
      create  app/views/layouts/application.html.erb
      create  app/views/layouts/mailer.html.erb
      create  app/views/layouts/mailer.text.erb
      create  app/assets/images/.keep
      create  app/assets/javascripts/channels
      create  app/assets/javascripts/channels/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/bundle
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  bin/update
      create  bin/yarn
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/cable.yml
      create  config/puma.rb
      create  config/spring.rb
      create  config/storage.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/application_controller_renderer.rb
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/content_security_policy.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/cors.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/new_framework_defaults_5_2.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/master.key
      append  .gitignore
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/apple-touch-icon-precomposed.png
      create  public/apple-touch-icon.png
      create  public/favicon.ico
      create  public/robots.txt
      create  tmp
      create  tmp/.keep
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor
      create  vendor/.keep
      create  test/fixtures
      create  test/fixtures/.keep
      create  test/fixtures/files
      create  test/fixtures/files/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/test_helper.rb
      create  test/system
      create  test/system/.keep
      create  test/application_system_test_case.rb
      create  storage
      create  storage/.keep
      create  tmp/storage
      create  tmp/storage/.keep
      remove  config/initializers/cors.rb
      remove  config/initializers/new_framework_defaults_5_2.rb
         run  bundle install
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......
Using rake 12.3.2
Following files may not be writable, so sudo is needed:
  /usr/bin
  /usr/share/gems
  /usr/share/gems/build_info
  /usr/share/gems/cache
  /usr/share/gems/doc
  /usr/share/gems/extensions
  /usr/share/gems/gems
  /usr/share/gems/specifications
Using concurrent-ruby 1.1.4
Using i18n 1.3.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Fetching nokogiri 1.9.1


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password: 


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password: 
Installing nokogiri 1.9.1 with native extensions
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2
Using rack 2.0.6
Using rack-test 1.1.0
Using actionpack 5.2.2
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.2
Using globalid 0.4.1
Using activejob 5.2.2
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using mimemagic 0.3.3
Using marcel 0.3.3
Using activestorage 5.2.2
Using public_suffix 3.0.3
Using addressable 2.5.2
Using io-like 0.3.0
Using archive-zip 0.11.0
Fetching bindex 0.5.0
Installing bindex 0.5.0 with native extensions
Fetching msgpack 1.2.4
Installing msgpack 1.2.4 with native extensions
Fetching bootsnap 1.3.2
Installing bootsnap 1.3.2 with native extensions
Using bundler 1.17.3
Fetching byebug 10.0.2
Installing byebug 10.0.2 with native extensions
Using regexp_parser 1.3.0
Using xpath 3.2.0
Using capybara 3.12.0
Fetching ffi 1.9.25
Installing ffi 1.9.25 with native extensions
Using childprocess 0.9.0
Using chromedriver-helper 2.1.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.2
Using coffee-rails 4.2.2
Using multi_json 1.13.1
Using jbuilder 2.8.0
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.0
Using ruby_dep 1.5.0
Using listen 3.1.5
Fetching puma 3.12.0
Installing puma 3.12.0 with native extensions
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.2.2
Using rubyzip 1.2.2
Using sass-listen 4.0.0
Using sass 3.7.2
Using tilt 2.0.9
Using sass-rails 5.0.7
Using selenium-webdriver 3.141.0
Using spring 2.0.2
Using spring-watcher-listen 2.0.1
Fetching sqlite3 1.3.13
Installing sqlite3 1.3.13 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/tmp/bundler20181231-7438-vajgn2sqlite3-1.3.13/gems/sqlite3-1.3.13/ext/sqlite3
/usr/bin/ruby -r ./siteconf20181231-7438-5nud2q.rb extconf.rb
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine
bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine
bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine
byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi
--version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine
msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine
nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine
puma --version 3.12.0
checking for sqlite3.h... no
sqlite3.h is missing. Try 'brew install sqlite3',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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}/lib64
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/$(RUBY_BASE_NAME)
	--with-sqlite3-config
	--without-sqlite3-config
	--with-pkg-config
	--without-pkg-config
	--with-sqlite3-dir
	--without-sqlite3-dir
	--with-sqlite3-include
	--without-sqlite3-include=${sqlite3-dir}/include
	--with-sqlite3-lib
	--without-sqlite3-lib=${sqlite3-dir}/lib64

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

/tmp/bundler20181231-7438-vajgn2sqlite3-1.3.13/extensions/x86_64-linux/2.5.0/sqlite3-1.3.13/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/tmp/bundler20181231-7438-vajgn2sqlite3-1.3.13/gems/sqlite3-1.3.13 for
inspection.
Results logged to
/tmp/bundler20181231-7438-vajgn2sqlite3-1.3.13/extensions/x86_64-linux/2.5.0/sqlite3-1.3.13/gem_make.out

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

In Gemfile:
  sqlite3
         run  bundle exec spring binstub --all
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
Could not find gem 'sqlite3' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
[henzy@localhost odin3]$ gem install sqlite3 -v '1.3.13' 
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
Building native extensions. This could take a while...
ERROR:  Error installing sqlite3:
	ERROR: Failed to build gem native extension.

    current directory: /home/henzy/.gem/ruby/gems/sqlite3-1.3.13/ext/sqlite3
/usr/bin/ruby -r ./siteconf20181231-26814-xzq5ta.rb extconf.rb
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
checking for sqlite3.h... no
sqlite3.h is missing. Try 'brew install sqlite3',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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}/lib64
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/$(RUBY_BASE_NAME)
	--with-sqlite3-config
	--without-sqlite3-config
	--with-pkg-config
	--without-pkg-config
	--with-sqlite3-dir
	--without-sqlite3-dir
	--with-sqlite3-include
	--without-sqlite3-include=${sqlite3-dir}/include
	--with-sqlite3-lib
	--without-sqlite3-lib=${sqlite3-dir}/lib64

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

  /home/henzy/.gem/ruby/extensions/x86_64-linux/2.5.0/sqlite3-1.3.13/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/henzy/.gem/ruby/gems/sqlite3-1.3.13 for inspection.
Results logged to /home/henzy/.gem/ruby/extensions/x86_64-linux/2.5.0/sqlite3-1.3.13/gem_make.out
[henzy@localhost odin3]$ cd app1
[henzy@localhost app1]$ rails generate scaffold car make:string model:string year:integer
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
Could not find gem 'sqlite3' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
[henzy@localhost app1]$ rails db:migrate
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem pristine msgpack --version 1.2.4
Ignoring nokogiri-1.9.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.9.1
Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0
Could not find gem 'sqlite3' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems

#2

Have you tried using “sudo” to install?

Also it is trying to issue alternatives like “Ignoring puma-3.12.0 because its extensions are not built. Try: gem pristine puma --version 3.12.0”

Try using these alternatives to install the gem. You will need that in Ruby to configure some back end behavior on your code.