尝试在rails项目中安装mysql2时出现PGP关键问题
<p>我正在尝试在本地安装 Rails 项目的所有 gem。</p>
<p>我的 mysql2 有问题。当我尝试安装它时,出现以下错误:</p>
<pre class="brush:php;toolbar:false;">Fetching mysql2-0.5.5.gem
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-x86_64-libmariadbclient
error: mingw32: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" could not be looked up remotely
error: mingw64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" could not be looked up remotely
error: msys: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" could not be looked up remotely
error: database 'mingw32' is not valid (invalid or corrupted database (PGP signature))
error: database 'mingw64' is not valid (invalid or corrupted database (PGP signature))
error: database 'msys' is not valid (invalid or corrupted database (PGP signature))
pacman failed with the following output:
Building native extensions with: '--with-mysql-lib="C:\Program Files\MySQL\MySQL Server 8.0\lib" --with-mysql-include="C:\Program Files\MySQL\MySQL Server 8.0\include"'
This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.</pre>
<p>然后我尝试运行 <code>pacman -Syu</code>,但也出现相同的错误,并且没有要求我导入 PGP 密钥。</p>
<p>因此,我尝试根据 MSI 密钥环 GitHub 中的 pacman-key --add </code> 手动导入密钥。然后,我使用 <code>pacman-key --edit-key</code> 将信任更改为 Ultimate。</p>
<p>但是现在,我遇到了另一个错误:</p>
<pre class="brush:php;toolbar:false;">Installing required msys2 packages: mingw-w64-x86_64-libmariadbclient
error: could not open file /var/lib/pacman/sync/mingw32.db: Child process exited with status 127
error: could not open file /var/lib/pacman/sync/mingw64.db: Child process exited with status 127
error: could not open file /var/lib/pacman/sync/msys.db: Child process exited with status 127
error: target not found: mingw-w64-x86_64-libmariadbclient
pacman failed with the following output:
Building native extensions with: '--with-mysql-lib="C:\Program Files\MySQL\MySQL Server 8.0\lib" --with-mysql-include="C:\Program Files\MySQL\MySQL Server 8.0\include"'
This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.</pre>
<p>我不知道我是否以这种方式添加了错误的密钥,或者错误是否来自其他原因。我已经为此苦苦挣扎了好几天,我有点迷失了。有人可以帮忙吗?</p>