3
respostas

Erro ao Instalar o sqlite3

Olá pessoal.

Estou tentando iniciar meu curso de Ruby on Rails e ao tentar instalar o sqlite3 conforme comando "C:\Users\iron_>gem install sqlite3" apresenta o erro abaixo. Eu utilizo Windows.

C:\Users\iron_>gem install sqlite3 Temporarily enhancing PATH for MSYS/MINGW... Installing required msys2 packages: mingw-w64-x86_64-sqlite3 atenção: Chaveiro público não localizado; você executou "pacman-key --init"? erro: mingw32: a chave "AD351C50AE085775EB59333B5F92EFC1A47D45A1" é desconhecida erro: a chave "AD351C50AE085775EB59333B5F92EFC1A47D45A1" não pôde ser procurado remotamente erro: mingw64: a chave "AD351C50AE085775EB59333B5F92EFC1A47D45A1" é desconhecida erro: a chave "AD351C50AE085775EB59333B5F92EFC1A47D45A1" não pôde ser procurado remotamente erro: msys: a chave "AD351C50AE085775EB59333B5F92EFC1A47D45A1" é desconhecida erro: a chave "AD351C50AE085775EB59333B5F92EFC1A47D45A1" não pôde ser procurado remotamente erro: "mingw32" base de dados não é válida (base de dados inválida ou corrompida (assinatura PGP)) erro: "mingw64" base de dados não é válida (base de dados inválida ou corrompida (assinatura PGP)) erro: "msys" base de dados não é válida (base de dados inválida ou corrompida (assinatura PGP)) pacman failed with the following output: 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.2/ext/sqlite3

C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20200202-18680-3fpl9h.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:/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

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.2/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.2 for inspection. Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/sqlite3-1.4.2/gem_make.out

3 respostas

Eu não sei se isso resolve, mas as vezes compensa usar um outro terminal. Já tentou usar o Git bash?

https://gitforwindows.org/

Das vezes que utilizei Ruby on Rails no Windows, eu utilizei esse terminal pois ele vem com muitas coisas já prontas para utilizar.... desde bibliotecas e outros.

Recomendo!

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.3'

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 5.2.0'

Use sqlite3 as the database for Active Record

gem 'sqlite3'

Use Puma as the app server

gem 'puma', '~> 3.11'

Use SCSS for stylesheets

gem 'sass-rails', '~> 5.0'

Use Uglifier as compressor for JavaScript assets

gem 'uglifier', '>= 1.3.0'

See https://github.com/rails/execjs#readme for more supported runtimes

gem 'duktape'

Use CoffeeScript for .coffee assets and views

gem 'coffee-rails', '~> 4.2'

Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks

gem 'turbolinks', '~> 5'

Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'jbuilder', '~> 2.5'

Use Redis adapter to run Action Cable in production

gem 'redis', '~> 4.0'

Use ActiveModel has_secure_password

gem 'bcrypt', '~> 3.1.7'

Use ActiveStorage variant

gem 'mini_magick', '~> 4.8'

Use Capistrano for deployment

gem 'capistrano-rails', group: :development

Reduces boot times through caching; required in config/boot.rb

gem 'bootsnap', '>= 1.1.0', require: false

group :development, :test do

Call 'byebug' anywhere in the code to stop execution and get a debugger console

gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end

group :development do

Access an interactive console on exception pages or by calling 'console' anywhere in the code.

gem 'web-console', '>= 3.3.0' end

group :test do

Adds support for Capybara system testing and selenium driver

gem 'capybara', '>= 2.15', '< 4.0' gem 'selenium-webdriver'

Easy installation and use of chromedriver to run system tests with Chrome

gem 'chromedriver-helper' end

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Fala Éder, como vai?

Pode por gentileza alterar a versão do sqlite no gemfile para:

gem 'sqlite3', '~> 1.3.0'

Após alteração, execute o comando bundle update para atualizar a gem. Nos fale se deu certo.

: )

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software