【问题标题】:pushing into heroku repo推入heroku repo
【发布时间】:2013-07-06 07:58:00
【问题描述】:

我目前正在学习如何使用 Heroku,但遇到了一些麻烦。

当我输入命令时

    git push heroku master

我收到消息

    Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
    Permission denied (publickey).

我目前在我的计算机上设置了 git,并为我的机器添加了 RSA 密钥。

我假设有一个单独的 RSA 密钥需要添加到我的 heroku 帐户?我不完全确定。

***编辑***** ********

我发现出了什么问题。我需要添加我的密钥

    heroku keys:add ~/.ssh/id_rsa.pub

但是,我现在遇到了另一个问题。

基本上,我创建了一个我想上传的 Rails 应用程序,但我在我的 heroku 帐户中删除了它。我创建了另一个应用程序,我想使用这个应用程序。但是当我

    git push heroku master

我会收到消息的

    No such app as rocky-gorge-9306 

rocky-gorge-9306 是我以前的应用,而不是我创建的新应用

当我输入命令时

    git remote -v

我明白了

    heroku  git@heroku.com:rocky-gorge-9306.git (fetch)  <---- old deleted app that does not exist 
    heroku  git@heroku.com:rocky-gorge-9306.git (push)
    origin  https://github.com/liondancer/first_app.git (fetch)
    origin  https://github.com/liondancer/first_app.git (push)

【问题讨论】:

  • 推送前我已经登录了
  • 你确定远程heroku指向你在heroku上的应用程序git repo吗?确保heroku apps:info --app your-app-namegit remote -v show heroku 中的git url 相同。
  • 我想我很困惑;/我正在尝试将我的 RoR 应用程序上传到 heroku
  • 是的,我明白了。要将您的应用程序上传到 heroku,您可以像在 github 上一样将代码推送到 heroku。为此,您应该能够建立与 heroku 的 ssh 连接,并且您应该有权推送到远程仓库。第一条评论是确保您可以 ssh 到 heroku,第二条是确保您推送到正确的仓库,即您有权推送到的仓库。

标签: ruby-on-rails heroku heroku-toolbelt


【解决方案1】:

我假设,您的开发机器上有公钥/私钥。如果不, 执行以下操作:

ssh-keygen -t rsa

Heroku 配置

  1. 安装Heroku Toolbelt
  2. 配置您的 Heroku 帐户:heroku login
  3. 验证,您的 git heroku 配置正确:git remote -v。 如果没有,请执行以下操作:heroku git:remote -a your_heroku_app_name
  4. 现在你应该可以推送到heroku:git push heroku master

【讨论】:

  • 尝试创建一个新的rails应用和heroku:1. rails new mytest 2. cd mytest 3. git init 4. git add .; git commit -am 'initial import' 5. heroku create 6. git push heroku master
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-03-20
  • 1970-01-01
  • 1970-01-01
  • 2013-07-19
  • 2020-02-02
  • 2012-12-09
  • 2011-08-24
相关资源
最近更新 更多