git - 为多个环境 fork 我现有的 heroku 应用程序

标签 git heroku deployment ruby-on-rails-4

我正在尝试 fork 我现有的应用程序,以便我可以创建一个与生产环境分开的暂存环境,但无论我尝试什么,我都会遇到错误。

我肯定有一个 heroku 工具带,而且我肯定已经登录了。

当我运行 git remote -v我明白了:

origin  https://github.com/account/mysite.git (fetch)
origin  https://github.com/account/mysite.git (push)
production  git@heroku.com:mysite.git (fetch)
production  git@heroku.com:mysite.git (push)

当我运行 heroku fork -a production staging我明白了:

Failed to fork app production to staging.

     !    WARNING: Potentially Destructive Action
 !    This command will destroy staging (including all add-ons).
 !    To proceed, type "staging" or re-run this command with --confirm staging

如果我输入 staging然后我明白了:

Deleting staging... failed
 !    You do not have access to the app staging.

我感到困惑的是,为什么它认为存在一个名为“staging”的应用程序,我正在尝试将其作为一个新环境进行 fork 。

当我在终端中尝试其他建议时,我得到了这个:

heroku fork -a production --confirm staging
 !    Mismatch between --app and --confirm
Failed to fork app  to .
 !    Confirmed app staging did not match the selected app .

当我尝试 heroku apps:info我得到:

 !    App not found

这看起来也很奇怪。如果我指定 heroku apps:info --app stagingheroku apps:info --app production然后我得到

 !    You do not have access to the app staging.

当我尝试 git remote rm staging它只是确认没有“暂存”环境:

error: Could not remove config section 'remote.staging'

我似乎也没有工作的“生产”方面,就像我做的那样git push production master我明白了

 !  No such app as mysite.

但是当我访问http://mysite.herokuapp.com它绝对存在!

这让我发疯 - 谁能帮忙?

最佳答案

staging 应该是您正在创建的应用程序的名称,而不是 git remote 的名称。您需要选择一个唯一的名称。我通常使用 mysite-prodmysite-staging 作为我的应用程序名称。

关于git - 为多个环境 fork 我现有的 heroku 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22313648/

相关文章:

java - 如何将 weblogic 的部署模式设置为 nostage?

visual-studio - 从 MSBuild 发布中排除 `.js` 文件但不排除 '.min.js' 文件

git - 我如何告诉 Git 它移动/重命名错误(误报)

heroku - 减少 Heroku 上的 Clojure 启动时间(错误 R10)

unix - 如何在 Heroku 中运行 Meteor shell?

node.js - 无法在 Heroku 上部署 Hubot

azure - Visual Studio Code 无法部署到 azure - 凭据参数需要实现signREQUEST

git - 将文件和目录连同提交历史一起移动到子目录中

git - Android Studio 项目的 .gitignore 中应该包含什么?

Git:不存储子模块的历史