【问题标题】:Why am I unable to push my app to Heroku?为什么我无法将我的应用推送到 Heroku?
【发布时间】:2015-01-21 15:59:15
【问题描述】:

由于某种原因,我无法让 Heroku 更新我的应用程序。这是我遇到这种情况的第一个应用程序。我尝试了几种不同的方法,但我尝试过的所有内容都只是在命令“一切都是最新的”中说的。当我检查 heroku 时,它只是我的应用程序的早期版本。知道为什么它不会在 Heroku 上更新吗?

这是我尝试过的:

$ bundle exec rake test
$ git add -A
$ git commit -m "..."  
$ git checkout master 
$ git merge blah 
$ bundle exec rake test
$ git push
$ git push heroku 
$ heroku run rake db:migrate

我也试过这个:

$ git status  
$ git add .
$ git commit -m "..."
$ git push heroku master
$ heroku run db:migrate

这是 git 状态:

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

这里是强行装逼

$ git push heroku master --force
Everything up-to-date

这里是 git remote -v

heroku  https://git.heroku.com/stupidapp1.git (fetch)
heroku  https://git.heroku.com/stupidapp1.git (push)
origin  https://github.com/Tyrantt47/stupidapp1.git (fetch)
origin  https://github.com/Tyrantt47/stupidapp1.git (push)

【问题讨论】:

  • 尝试heroku is telling "everything up to date"每个搜索结果。
  • 我刚试过:$ git push heroku log-in-log-out:master,它又说一切都是最新的。但什么都没有改变。我的变化是白天和黑夜。
  • 你确定你推送的是正确的分支吗?你能用“git status”的输出来编辑你的问题吗?
  • 试试 git remote -v。 'heroku' 的路径是否与 heroku 应用程序的存储库匹配?

标签: ruby-on-rails ruby git heroku


【解决方案1】:

Curtis,我觉得这个答案可能会被认为是优秀开发人员的对立面,但如果您将要部署的代码签入版本控制和本地,为什么不将其推送到新的 Heroku 应用程序。

如果存储库的名称可以表明应用程序的规模,我会说尝试一下并查看结果。

Heroku 提供了有关将数据库从一个应用程序迁移到另一个应用程序的良好文档,并且它的附加服务很容易设置,如果其中任何一个存在问题的话。

深思……

【讨论】:

  • 是的,我认为这最终是我要做的,但我想知道我搞砸了什么,所以我可以确保它不会再次发生。猜想我会继续做下去。所以我创建了一个新应用程序,如何将这个应用程序更改为新应用程序?
  • 我应该分叉吗?我这样做了,它所做的只是将应用程序的副本创建到新应用程序中。如果代码和应用程​​序的任何问题完全相同,不确定如何解决它..
  • 我是否应该将目录复制/粘贴到克隆应用程序的新目录中并使用 git hub 进行设置?我有点迷路了
  • 所以我创建了一个新的存储库和一个新的 heroku 应用程序,将代码复制过来,在本地服务器上,一切似乎都正常......但在 heroku 方面,应用程序位于完全相同的地方,它不会在其他应用程序上更新过去。几个小时以来,我一直试图弄清楚这一点。还有其他建议吗?
【解决方案2】:

我认为语法是

git push -f heroku master

【讨论】:

  • "一切都是最新的"
猜你喜欢
  • 2015-07-09
  • 1970-01-01
  • 2016-05-26
  • 2014-08-05
  • 1970-01-01
  • 2020-08-22
  • 2021-10-05
  • 1970-01-01
  • 2013-09-11
相关资源
最近更新 更多