简体   繁体   English

git push heroku master - 没有错误消息,但更改没有显示在Web应用程序上

[英]git push heroku master - no error messages but changes not displaying on web app

After installing the devise gem to create users on my web app, my changes are not appearing on the live app. 安装devise gem以在我的Web应用程序上创建用户后,我的更改不会出现在实时应用程序上。

I believe I am running the correct code in terminal (I am following the one-month-rails course): 我相信我在终端中运行了正确的代码(我正在遵循一个月的铁路课程):

$ git add .
$ git commit -am "message"
$ git push  
$ git push heroku master

The push to heroku runs through and I don't receive an error message, however, when I try to access my heroku page 推送到heroku时,我没有收到错误消息,但是,当我尝试访问我的heroku页面时

$ heroku open

The changes are not displayed on the live web-app. 更改不会显示在实时Web应用程序中。

All the changes are displayed when running the rails server on the localhost. 在localhost上运行rails服务器时,将显示所有更改。 Furthermore, the activity log on the heroku website shows that my push went through and that its running the same version as my most recent push to github. 此外,heroku网站上的活动日志显示我的推送已完成,并且其运行与我最近推送到github的版本相同。

Any thoughts? 有什么想法吗?

Best, Brian 最好的,布莱恩

** Also posted this response here: git push heroku master says "Everything up-to-date", but the app is not current **也在这里发布了这个回复: git push heroku master说“一切都是最新的”,但应用程序不是最新的

Even though this is an old issue, I wanted to update with what worked for me (a newbie) should anyone else run into this: 虽然这是一个老问题,但是我想更新一下对我来说有什么用(新手)应该有人遇到这个:

After following the instructions here (from Hudson), what finally did the trick for me was doing a "git pull" after checking out the "master" branch. 按照这里的说明(来自Hudson)之后,最终为我做的诀窍是在检查出“master”分支后进行“git pull”。 Perhaps "git push heroku master" pushes out only the local branch of master? 也许“git push heroku master”只推出了master的本地分支?

Of course, this assumes all required changes have been correctly merged into your master. 当然,这假设所有必需的更改已正确合并到主服务器中。 I hadn't pulled from master on my local since the project set up because all merges (from development to master) were handled on GitHub and I had been working on new branches that were later merged with development. 自项目设置以来,我没有从我当地的主人那里撤离,因为所有的合并(从开发到掌握)都是在GitHub上处理的,我一直在研究新的分支,后来又与开发合并。

So, to restate steps above from Hudson: 所以,重申Hudson的上述步骤:

git checkout master

git pull

(here, I updated README to have a change to commit, like "Heroku deploy [date, time]" (在这里,我更新了README以进行提交更改,例如“Heroku deploy [date,time]”

git add .

git commit -am "xxxyyzzz"

git push heroku master

heroku run rake db:migrate

heroku restart

Good luck! 祝好运!

You should take care of following things when you have your hands on heroku 当你掌握heroku时,你应该注意以下事项

  1. run pending migrations if any heroku run rake db:migrate 如果任何heroku run rake db:migrate则运行挂起的heroku run rake db:migrate
  2. restart your heroku app after successful run of migrations heroku restart not needed if you have only code changes, but a good practice to do. 成功运行迁移后重新启动heroku应用程序如果只进行代码更改,则不需要heroku restart ,但这是一个很好的做法。
  3. verify assets are getting compiled properly on a push, if not you can heroku run rake assets:precompile 验证资产是否在推送时正确编译,如果不是,你可以heroku run rake assets:precompile

I could resolve my issue only by making a new_branch and pushing that on heroku: 我只能通过创建一个new_branch并在heroku上推送它来解决我的问题:

git checkout -b new_branch
git add .
git commit -m "Just a test commit to push new branch to heroku"
git push heroku new_branch:master
heroku restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM