wafuの技術

技術習得の努力メモです。

Rubyのインストールエラーへの対応

久しぶりにRubyをインストールしたところ、エラーでインストールできません。

以前、あんなに簡単に入ったのに困りました。

 

インストールしたのは、RubyInstall+MSYS2です。

 

Rubyだけを入れた場合は、gemでsqlite3を入れると証明書関係のエラーが出るのでMSYS2は必要と思います。

 

■インストール対象

RubyInstallerからRuby+Devkit2.6.6-1(x64)です。

RubyInstaller for Windows

 

■手順

rubyinstaller-devkit-2.6.6-1-x64.exeを実行

 

■エラー内容

Rubyをインストール後、MSYS2のインストール画面が表示されます。

1 - MSYS2 base installation
2 - MSYS2 system update (optional)
3 - MSYS2 and MINGW development toolchain

Which components shall be installed? If unsure press ENTER [1,3]

1を選択

 

 

Which components shall be installed? If unsure press ENTER [1,3] 1

> sh -lc true
'C:\WINDOWS\system32\drivers\etc\hosts' -> '/etc/hosts'
'C:\WINDOWS\system32\drivers\etc\protocol' -> '/etc/protocols'
'C:\WINDOWS\system32\drivers\etc\services' -> '/etc/services'
'C:\WINDOWS\system32\drivers\etc\networks' -> '/etc/networks'
gpg: /etc/pacman.d/gnupg/trustdb.gpg: 信用データベースができました
gpg: 究極的に信用する鍵が見つかりません
gpg: starting migration from earlier GnuPG versions
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: error: GnuPG agent unusable. Please check that a GnuPG agent can be started.
gpg: migration aborted
gpg: starting migration from earlier GnuPG versions
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: error: GnuPG agent unusable. Please check that a GnuPG agent can be started.
gpg: migration aborted
gpg: Generating pacman keyring master key...
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: agent_genkey failed: エージェントが動いていません
gpg: key generation failed: エージェントが動いていません
gpg: Done
==> 信用データベースを更新...
gpg: 信用データベースの検査は、不要です
==> msys2.gpg からキーを追加...
gpg: starting migration from earlier GnuPG versions
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: error: GnuPG agent unusable. Please check that a GnuPG agent can be started.
gpg: migration aborted
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
==> キーリングの信頼されたキーに署名...
-> キーに署名 D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A...
==> エラー: D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A に署名できませんでした。
-> キーに署名 123D4D51A1793859C2BE916BBBE514E53E0D0813...
==> エラー: 123D4D51A1793859C2BE916BBBE514E53E0D0813 に署名できませんでした。
-> キーに署名 B91BCF3303284BF90CC043CA9F418C233E652008...
==> エラー: B91BCF3303284BF90CC043CA9F418C233E652008 に署名できませんでした。
-> キーに署名 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C...
==> エラー: 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C に署名できませんでした。
gpg: connecting dirmngr at '/etc/pacman.d/gnupg/S.dirmngr' failed: IPC connect呼び出しに失敗しました
gpg: 鍵サーバの更新に失敗しました: dirmngrがありません
==> エラー: キーサーバから特定のキーを更新できませんでした。
--> Installing /usr/share/info/assuan.info.gz ... done
--> Installing /usr/share/info/autoconf.info.gz ... done
--> Installing /usr/share/info/autoconf2.13.info.gz ... done
--> Installing /usr/share/info/autogen.info.gz ... done
--> Installing /usr/share/info/automake1.10.info.gz ... done
--> Installing /usr/share/info/automake1.11.info.gz ... done
--> Installing /usr/share/info/automake1.12.info.gz ... done
--> Installing /usr/share/info/automake1.13.info.gz ... done
--> Installing /usr/share/info/automake1.14.info.gz ... done
--> Installing /usr/share/info/automake1.15.info.gz ... done
--> Installing /usr/share/info/automake1.16.info.gz ... done
--> Installing /usr/share/info/automake1.6.info.gz ... done
--> Installing /usr/share/info/automake1.7.info.gz ... done
--> Installing /usr/share/info/automake1.8.info.gz ... done
--> Installing /usr/share/info/automake1.9.info.gz ... done
--> Installing /usr/share/info/automake-history1.12.info.gz ...install-info: warning: `/usr/share/info/automake-history1.12.info.gz' に Info dir 用の項目がありません
done
--> Installing /usr/share/info/automake-history1.13.info.gz ...install-info: warning: `/usr/share/info/automake-history1.13.info.gz' に Info dir 用の項目がありません
done
--> Installing /usr/share/info/automake-history1.14.info.gz ...install-info: warning: `/usr/share/info/automake-history1.14.info.gz' に Info dir 用の項目がありません
done
--> Installing /usr/share/info/automake-history1.15.info.gz ...install-info: warning: `/usr/share/info/automake-history1.15.info.gz' に Info dir 用の項目がありません
done
--> Installing /usr/share/info/automake-history1.16.info.gz ...install-info: warning: `/usr/share/info/automake-history1.16.info.gz' に Info dir 用の項目がありません
done
--> Installing /usr/share/info/autosprintf.info.gz ... done
--> Installing /usr/share/info/bash.info.gz ... done
--> Installing /usr/share/info/coreutils.info.gz ... done
--> Installing /usr/share/info/diffutils.info.gz ... done
--> Installing /usr/share/info/find.info.gz ... done
--> Installing /usr/share/info/find-maint.info.gz ... done
--> Installing /usr/share/info/flex.info.gz ... done
--> Installing /usr/share/info/gawk.info.gz ... done
--> Installing /usr/share/info/gawkinet.info.gz ... done
--> Installing /usr/share/info/gawkworkflow.info.gz ... done
--> Installing /usr/share/info/gcrypt.info.gz ... done
--> Installing /usr/share/info/gdbm.info.gz ... done
--> Installing /usr/share/info/gettext.info.gz ... done
--> Installing /usr/share/info/gmp.info.gz ... done
--> Installing /usr/share/info/gnupg.info.gz ... done
--> Installing /usr/share/info/gnutls.info.gz ... done
--> Installing /usr/share/info/gnutls-guile.info.gz ... done
--> Installing /usr/share/info/gpgme.info.gz ... done
--> Installing /usr/share/info/grep.info.gz ... done
--> Installing /usr/share/info/gzip.info.gz ... done
--> Installing /usr/share/info/history.info.gz ... done
--> Installing /usr/share/info/inetutils.info.gz ... done
--> Installing /usr/share/info/info-stnd.info.gz ... done
--> Installing /usr/share/info/ksba.info.gz ... done
--> Installing /usr/share/info/libffi.info.gz ... done
--> Installing /usr/share/info/libgomp.info.gz ... done
--> Installing /usr/share/info/libidn2.info.gz ... done
--> Installing /usr/share/info/libquadmath.info.gz ... done
--> Installing /usr/share/info/libtasn1.info.gz ... done
--> Installing /usr/share/info/libtool.info.gz ... done
--> Installing /usr/share/info/libunistring.info.gz ... done
--> Installing /usr/share/info/m4.info.gz ... done
--> Installing /usr/share/info/make.info.gz ... done
--> Installing /usr/share/info/mpfr.info.gz ... done
--> Installing /usr/share/info/nettle.info.gz ... done
--> Installing /usr/share/info/pinentry.info.gz ... done
--> Installing /usr/share/info/readline.info.gz ... done
--> Installing /usr/share/info/rluserman.info.gz ... done
--> Installing /usr/share/info/sed.info.gz ... done

 

入ったのかな?

たぶん、入っていないと思われます。

次に2のupdateです。

 

Which components shall be installed? If unsure press ENTER [] 2

> sh -lc true
MSYS2 seems to be properly installed
Remove catgets to avoid conflicts while update ...
> pacman -Rdd catgets libcatgets --noconfirm
エラー: mingw32: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: mingw64: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: msys: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: 対象が見つかりませんでした: catgets
エラー: 対象が見つかりませんでした: libcatgets
MSYS2 system update (optional) part 1 ...
> pacman -Syu --needed --noconfirm
エラー: mingw32: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: mingw64: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: msys: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
:: パッケージデータベースの同期中...
MSYS2 system update (optional) failed
Installation failed: pacman failed

 

入っていません。

この状態で、sqlite3のインストールを試みます。

gem install sqlite3
Fetching sqlite3-1.4.2.gem
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-x86_64-sqlite3
エラー: mingw32: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: mingw64: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: msys: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" の署名は信頼されていません
エラー: データベース 'mingw32' は無効です (無効または破損したデータベース (PGP 鍵))
エラー: データベース 'mingw64' は無効です (無効または破損したデータベース (PGP 鍵))
エラー: データベース 'msys' は無効です (無効または破損したデータベース (PGP 鍵))
pacman failed with the following output:

 

エラーが出て入りません。

1つめの対応

WindowsからRubyディレクトリ内のmsys2.exeを起動します。

どこかで、見つけてきた下記のコマンドを入力します。

$ pacman-key --init
$ pacman-key --lsign-key A47D45A1
$ rm /var/lib/pacman/db.lck
$ pacman -Syu

 

あれ、これもエラー?

$ pacman-key --init
gpg: starting migration from earlier GnuPG versions
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました
gpg: error: GnuPG agent unusable. Please check that a GnuPG agent can be started.
gpg: migration aborted
gpg: can't connect to the agent: IPC connect呼び出しに失敗しました

 

 

gpg-agentが動作していない。

もう、よくわかりません。

 

 調べたところ、セキュリティソフトのファイアウォールが原因のようです。

WindowsのFWとセキュリティソフト(ウイルスバスター)のFWを止めました。

(先日は問題がなかったのですが、今日はどうなのでしょう。)

 

 

msys2.exeを起動して、下記のコマンドで証明書を設定します。

(ネットにありましたが、大丈夫なのかな。今度はうまくいきました。)

$ pacman-key --init
$ pacman-key --lsign-key A47D45A1
$ rm /var/lib/pacman/db.lck
$ pacman -Syu

 

この設定のパーソナルファイアウォールの設定を変えるかもしくは、

C:\Ruby26-x64\msys64\etc ディレクトリににある。
pacman.conf ファイルを設定する方法もあります。

 

pacman.confファイルの19行目付近の

#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u

の先頭の#を外します。

 

pacmanコンパイル環境を入れます。

$ pacman -S gcc

$ pacman -S make

これで、終了です。

 

貴重な1日が・・・・