未能将git推送到Heroku端口22:文件编号错误

Pos*_*ter 7 git ssh heroku git-push

创建我的rails项目后,将其推入GIT仓库,无法将其推送到Heroku.当我运行命令时:

git push heroku master
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

ssh: connect to host heroku.com port 22: Bad file number
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

我不是在防火墙,代理或VPN后面.我已经运行了

  heroku status
Run Code Online (Sandbox Code Playgroud)

它工作正常.

我甚至确保ssh与Git一起工作正常.并运行

 ssh -vT git@github.com
Run Code Online (Sandbox Code Playgroud)

它运行成功

我跑

 telnet heroku.com 22 
Run Code Online (Sandbox Code Playgroud)

它失败了

 connecting to heroku.com .. could not open connection to the host, on port 22:Connect failed
Run Code Online (Sandbox Code Playgroud)

也运行并失败

 ssh git@heroku.com
 ssh: connect to host heroku.com port 22: bad file number
Run Code Online (Sandbox Code Playgroud)

小智 1

可怕的坏文件号。这是 git 的 PC LOAD LETTER。这是难以理解的,但几乎总是一把坏钥匙。尝试在 heroku 中更新您的密钥,并确保您在尝试连接时提供正确的密钥。