2
respostas

ERRO no comando gem install sqlite3

PS C:\estudos\ruby\ruby on rails\loja> 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.1/ext/sqlite3

C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20191122-6596-kjl8eg.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.

2 respostas

Olá Henrique, como vai?

Poderia por gentileza realizar os passos abaixos e nos dizer se resolve o seu problema:

1) Ir no gemfile
2) Onde tem " gem 'sqlite3', '~>1.4.0' " remover o '~>1.4.0' e trocar por '~>1.3.6'
3) Rodar o comando bundle update

Joia e você? Isso deu certo + ou - eu tive que mudar o a versão do ruby para 2.5.3 para executar o comando bundle update(isso funcionou). Mas quando uso o comando rails server da erro(erro a baixo).

Traceback (most recent call last): 22: from bin/rails:4:in <main>' 21: from bin/rails:4:inrequire' 20: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.2.4/lib/rails/commands.rb:18:in <top (required)>' 19: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.2.4/lib/rails/command.rb:46:ininvoke' 18: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.2.4/lib/rails/command/base.rb:69:in perform' 17: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:indispatch' 16: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' 15: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:inrun' 14: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.2.4/lib/rails/commands/server/server_command.rb:142:in perform' 13: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.2.4/lib/rails/commands/server/server_command.rb:142:intap' 12: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.2.4/lib/rails/commands/server/server_command.rb:145:in block in perform' 11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.2.4/lib/rails/commands/server/server_command.rb:145:inrequire' 10: from C:/estudos/ruby/ruby on rails/loja/config/application.rb:7:in <top (required)>' 9: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler.rb:114:inrequire' 8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in require' 7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:ineach' 6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in block in require' 5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:ineach' 4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:81:in block (2 levels) in require' 3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:81:inrequire' 2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:2:in <top (required)>' 1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:inrescue in <top (required)>' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)