部署时主机密钥验证失败

问题描述

如何允许 Heroku 从远程仓库读取数据?

       Fetching gem Metadata from https://rubygems.org/............
       Fetching git@github.com:charlotte-ruby/impressionist.git
       Host key verification Failed.
       fatal: Could not read from remote repository.
       
       Please make sure you have the correct access rights
       and the repository exists.

显然是 Impressionist gem 导致了问题。包括它在我的应用中运行所需的特定提交。

在我的 gem 文件中包含:

gem 'impressionist',git: 'git@github.com:charlotte-ruby/impressionist.git',ref: '46a582ff8cd3496da64f174b30b91f9d97e86643'

我的完整错误日志如下

-----> Building on the Heroku-18 stack
-----> Ruby app detected
-----> Installing bundler 2.2.11
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.7.0
-----> Installing dependencies using bundler 2.2.11
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       Fetching gem Metadata from https://rubygems.org/............
       Fetching git@github.com:charlotte-ruby/impressionist.git
       Host key verification Failed.
       fatal: Could not read from remote repository.
       
       Please make sure you have the correct access rights
       and the repository exists.
       
       retrying `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` at /tmp/build_7762f75c_ due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory '/tmp/build_7762f75c_'
       
       retrying `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` at /tmp/build_7762f75c_ due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory '/tmp/build_7762f75c_'
       
       retrying `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` at /tmp/build_7762f75c_ due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory '/tmp/build_7762f75c_'
       
       Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git
       /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d
       --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory
       '/tmp/build_7762f75c_'
       Bundler Output: Fetching gem Metadata from https://rubygems.org/............
       Fetching git@github.com:charlotte-ruby/impressionist.git
       Host key verification Failed.
       fatal: Could not read from remote repository.
       
       Please make sure you have the correct access rights
       and the repository exists.
       
       retrying `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` at /tmp/build_7762f75c_ due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory '/tmp/build_7762f75c_'
       
       retrying `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` at /tmp/build_7762f75c_ due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory '/tmp/build_7762f75c_'
       
       retrying `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` at /tmp/build_7762f75c_ due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory '/tmp/build_7762f75c_'
       
       Git error: command `git clone git@github.com:charlotte-ruby/impressionist.git
       /tmp/build_7762f75c_/vendor/bundle/ruby/2.7.0/cache/bundler/git/impressionist-d570f27b52352c8b29bc8d717d67ff237621ec8d
       --bare --no-hardlinks --quiet` in directory /tmp/build_7762f75c_ has Failed.
       
       If this error persists you Could try removing the cache directory
       '/tmp/build_7762f75c_'
 !
 !     Failed to install gems via Bundler.
 !
 !     Push rejected,Failed to compile Ruby app.
 !     Push Failed

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)