搜索

首页  >  问答  >  正文

尝试在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>
P粉155832941P粉155832941480 天前655

全部回复(1)我来回复

  • P粉054616867

    P粉0546168672023-09-02 10:50:03

    您安装的 MSYS2 或 pacman 包管理器似乎可能有问题。子进程以状态 127 退出可能表明存在各种问题。

    以下是我们可以尝试解决此错误的一些方法:

    1. 您可以首先使用以下命令更新 MSYS2 安装:
    pacman -Syu
    1. 如果这不起作用,我们可以尝试重新安装 MSYS2。

    2. 另一种方法可能是删除 pacman 缓存并重试。您可以通过以下方式执行此操作:

    pacman -Scc

    请注意 mingw-w64-x86_64-libmariadbclient 出现错误,您应该确认已安装所有必需的开发包。

    sudo pacman -S mysql

    可能还有一个开发包。在 Ubuntu 上它是“sudo apt install libmariadb-dev”或类似的东西,但我不确定对于 Arch Linux。

    回复
    0
  • 取消回复