Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从github克隆到heroku应用程序_Heroku_Github - Fatal编程技术网

从github克隆到heroku应用程序

从github克隆到heroku应用程序,heroku,github,Heroku,Github,我正在开发一个在Heroku上运行的部署应用程序,它允许我将克隆的git repo的分支推送到其他机器上进行部署 当我尝试从github克隆存储库时(如果有必要的话,可以从ruby应用程序克隆),会出现以下错误: 主机密钥验证失败 致命:远程端意外挂断。 为了解决这个问题,我签入了一个RSA密钥,该密钥已添加到我的github帐户的heroku应用程序中,但问题仍然存在 我试图从我的应用程序中调用ssh add,但出现以下错误: 无法打开与身份验证代理的连接 我尝试用ssh代理打开bashshe

我正在开发一个在Heroku上运行的部署应用程序,它允许我将克隆的git repo的分支推送到其他机器上进行部署

当我尝试从github克隆存储库时(如果有必要的话,可以从ruby应用程序克隆),会出现以下错误:

主机密钥验证失败

致命:远程端意外挂断。

为了解决这个问题,我签入了一个RSA密钥,该密钥已添加到我的github帐户的heroku应用程序中,但问题仍然存在

我试图从我的应用程序中调用
ssh add
,但出现以下错误:

无法打开与身份验证代理的连接

我尝试用ssh代理打开bashshell,但没有效果。下面是我试图添加ssh密钥的代码块

ruby
def self.add_ssh_密钥(路径=“~/.ssh”)
激活\u ssh\u代理=%x{exec ssh agent bash}
命令=%x{ssh add{path}
如果$?.exitstatus!=0
msg=“错误:无法添加ssh密钥”
结束
结束


有什么方法是我缺少的吗?

我已经改变了一些方法

使用SSH已经被证明是令人沮丧的,所以我改为通过https签出,凭证可以放在实际的repo名称中,这些凭证可以作为环境变量包含在heroku应用程序中

相关代码:

def self.clone_repo(repository_address)
  username = ENV["GITHUB_USER_NAME"]
  password = ENV["GITHUB_PASSWORD"]
  repo = "https://#{username}:#{password}@github.com/#{repository_address}"
  command = %x{git clone #{repo}}

  if $?.exitstatus != 0
    msg = "Git error: unable to clone repository #{repository_address}"
  end
end