質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
SQLite

SQLiteはリレーショナルデータベース管理システムの1つで、サーバーではなくライブラリとして使用されている。

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

1433閲覧

sqlite3パッケージのインストールができない

hattyarosu

総合スコア2

SQLite

SQLiteはリレーショナルデータベース管理システムの1つで、サーバーではなくライブラリとして使用されている。

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2020/08/25 07:31

前提・実現したいこと

Visual Studio Codeにて、Ruby on Rails6を用いてWebアプリを構築中です。
しかし、sqlite3パッケージをインストールしようとしたところ
sqlite3がインストールできません。

発生している問題・エラーメッセージ

エラーメッセージ Temporarily enhancing PATH for MSYS/MINGW... Installing required msys2 packages: mingw-w64-x86_64-sqlite3 エラー: mingw32: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" は不明です エラー: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" をリモートで検索できませんでした エラー: mingw64: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" は不明です エラー: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" をリモートで検索できませんでした エラー: msys: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" は不明です エラー: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" をリモートで検索できませんでした エラー: データベース 'mingw32' は無効です (無効または破損したデータベース (PGP 鍵)) エラー: データベース 'mingw64' は無効です (無効または破損したデータベース (PGP 鍵)) エラー: データベース 'msys' は無効です (無効または破損したデータベース (PGP 鍵)) pacman failed with the following output: :: PGP 鍵 4A6129F4E4B84AE46ED7F635628F528CF3053E04 をインポートしますか? [Y/n] :: PGP 鍵 4A6129F4E4B84AE46ED7F635628F528CF3053E04 をインポートしますか? [Y/n] :: PGP 鍵 4A6129F4E4B84AE46ED7F635628F528CF3053E04 をインポートしますか? [Y/n] Building native extensions. This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension. current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/ext/sqlite3 C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20200825-15976-1yjfpu7.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:/Ruby26-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:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.2/mkmf.log extconf failed, exit code 1 Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2 for inspection. Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.2/gem_make.out ### 該当のソースコード gem install sqlite3 ### 試したこと 初心者の為、なかなかエラーの読み取りにも手こずっております。 sqliteはすでにダウンロード済みで、sqlite3.dllとsqlite3.exeは、Windowsフォルダ内のsystem32に保存してあります。 gem install sqlite3 --version 1.3.13 --platform ruby を試しましたがうまく行かず、同じようなエラーが出ている投稿者の方は 「MSYS2上にdlfncパッケージをいれることで解決しました。」とのことですが、よく意味が分かりません。。。 ### 補足情報(FW/ツールのバージョンなど) Windowsを使用しています。ruby,rails,sqliteすべて最新のものです。 ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

https://qiita.com/rubytomato@github/items/6693cc925c1ce99fdd22

Ruby をインストールする際に MSYS2 のチェックを外していませんでしょうか。その場合、再度インストーラを実行して MSYS2 も入れてみてください。

投稿2020/08/25 13:52

saoyagi2

総合スコア210

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hattyarosu

2020/08/26 00:43

解答ありがとうございます。MSYS2は再度インストールしました。 また、 ・https://www.sqlite.org/download.html の一番上の sqlite-amalgamation-XXX.zip をダウンロード 解凍して sqlite3.h を取り出して system32 フォルダに入れる ・gem install sqlite3 --platform=ruby -- --with-sqlite3-include=C:/Windows/system32 --with-sqlite3-lib=C:/Windows/system32 を実行 これを試してみましたが、以下のエラーが出てきました。 Temporarily enhancing PATH for MSYS/MINGW... Installing required msys2 packages: mingw-w64-x86_64-sqlite3 エラー: mingw32: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" は不明です エラー: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" をリモートで検索できませんでした エラー: mingw64: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" は不明です エラー: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" をリモートで検索できませんでした エラー: msys: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" は不明です エラー: キー "4A6129F4E4B84AE46ED7F635628F528CF3053E04" をリモートで検索できませんでした エラー: データベース 'mingw32' は無効です (無効または破損したデータベース (PGP 鍵)) エラー: データベース 'mingw64' は無効です (無効または破損したデータベース (PGP 鍵)) エラー: データベース 'msys' は無効です (無効または破損したデータベース (PGP 鍵)) pacman failed with the following output: :: PGP 鍵 4A6129F4E4B84AE46ED7F635628F528CF3053E04 をインポートしますか? [Y/n] :: PGP 鍵 4A6129F4E4B84AE46ED7F635628F528CF3053E04 をインポートしますか? [Y/n] :: PGP 鍵 4A6129F4E4B84AE46ED7F635628F528CF3053E04 をインポートしますか? [Y/n] Building native extensions with: '--with-sqlite3-include=C:/Windows/system32 --with-sqlite3-lib=C:/Windows/system32' This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension. current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/ext/sqlite3 C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20200826-8340-7oebg5.rb extconf.rb --with-sqlite3-include\=C:/Windows/system32 --with-sqlite3-lib\=C:/Windows/system32 checking for sqlite3.h... *** 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:/Ruby26-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=${sqlite3-dir}/include --with-sqlite3-lib=${sqlite3-dir}/lib C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:601:in `try_cpp' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1162:in `block in find_header' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:357:in `postpone' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1161:in `find_header' from extconf.rb:68:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.2/mkmf.log extconf failed, exit code 1 Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2 for inspection. Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.2/gem_make.out
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問