嘗試在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>