I am trying to deploy a new version of my app to heroku and although running it locally works, I can't see any change after I do the following:
git push heroku master
and then
heroku run rake db:migrate
There seems to be no effect. It's strange because without a model change I was able to deploy changes with just the git push command. Any thoughts?
It sounds as if you might be not commiting your changes to Github first.
git add .
git commit -m "commit details here"
git push origin master
THEN
git push heroku master
If you're pushing and then migrating you then need to do
heroku restart
to have your application recache the DB schema.
I had the same issue and posted what worked for me in response to others' similar issues:
$git push heroku master - no error messages but changes not displaying on web app
git push heroku master says "Everything up-to-date", but the app is not current
Related
I run these commands
heroku create
git push heroku master
Then.
git remote add heroku https://git.heroku.com/radiant-chamber-18560.git
git push heroku master
What should I do?
Make sure you added and committed your code locally by
git add -A .
git commit -m "your commit message"
Then try sending you current git HEAD to heroku master branch instead.
git push heroku HEAD:master
From your error, it seems Heroku is not being able to detect you are deploying a RoR application. Make sure your Gemfile is being sent to Heroku (see here for more info). You can use #Felipe_Sabino's answer to make sure it is added to git.
Also you could set the buildpack manually, but it shouldn't be necessary if all files are correct.
I successfully deployed my rails app on heroku and launched officially but can't make a change to my rails app. I run git push heroku after I edited html code but nothing changed on home page.
I get below when I run git push heroku
everything up to date
I'm sure I run git add ., git commit before git push heroku. Does anyone know why? I need your help.
Make sure you're on the master branch which Heroku uses to deploy your app. So run git checkout master before adding and committing your file. Then use git push heroku master to deploy.
I am not able to push to staging for heroku.
When I am doing git remote staging master I am getting
fatal: 'staging' does not appear to be a git repository
fatal: Could not read from remote repository.
Although I used to push to staging using the same command.
git remote -v
returns
origin git#bitbucket.abc/test.git (fetch)
origin git#bitbucket.org:abc/test.git (push)
I tried to add a git remote, but It created something else and when I did git push staging master, It created another url of the app instead of pushing for the earlier staging url.
I am not able to resolve this. Also I am the owner of the heroku app.
There is only one git repo configured here, and that is a bitbucket git repo. You need to add the heroku configuration too. See this link for reference.
Ultimately, run something like heroku git:remote -a heroku-app-name -r staging. Then you can do git push staging master and it'll push to the given app.
After installing the devise gem to create users on my web app, my changes are not appearing on the live app.
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 open
The changes are not displayed on the live web-app.
All the changes are displayed when running the rails server on the localhost. 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.
Any thoughts?
Best,
Brian
** Also posted this response here: git push heroku master says "Everything up-to-date", but the app is not current
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. Perhaps "git push heroku master" pushes out only the local branch of 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.
So, to restate steps above from Hudson:
git checkout master
git pull
(here, I updated README to have a change to commit, like "Heroku deploy [date, time]"
git add .
git commit -am "xxxyyzzz"
git push heroku master
heroku run rake db:migrate
heroku restart
Good luck!
I could resolve my issue only by making a new_branch and pushing that on 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
You should take care of following things when you have your hands on heroku
run pending migrations if any heroku run rake db:migrate
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.
verify assets are getting compiled properly on a push, if not you can heroku run rake assets:precompile
I got this error message (copied below) after trying to push to Heroku. I initially set up a facebook canvas app and selected the hosting on heroku options. It gave me a heroku url, which I added as a remote on the app I was developing on my machine
heroku git:remote -a desolate-springs-1684
But when I pushed, I got this error
error: failed to push some refs to 'git#heroku.com:desolate-springs-1684.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
localhost:nhl michaelmitchell$
So I did
git push -f heroku master
But now I apparently have to do a 'git pull'. However, what do i put after the 'git pull'? The name of the heroku url? or something else?
Forcing your git push was not a good idea because you lost any commit that was done by you or other collaborators you were missing on your working copy.
Before pushing, you should have either merged or rebased the upstream changes into your local working copy.
To merge the changes locally
$ git pull heroku master
$ git push heroku master
To rebase the changes locally
$ git pull --rebase heroku master
$ git push heroku master
BTW, now that you have pushed your changes, you actually don't need to do anything else. The remote repository already contains all your changes.
If for whatever reason the $ git status command is returning outdated references, simply run
$ git pull heroku
to fetch all the remote changes. Please note that unless you specify a target branch (or you have the tracking branch enabled), git pull will simply download (and not merge) the upstream changes.
Also note that Heroku should not be considered a git hosting. It means that it's extremely uncommon to perform a git pull from Heroku. Instead, you should use a git hosting (such as GitHub or BitBucket) to store your repository and only perform push to Heroku to deploy the application.
That error basically means that there is code in the repo that is newer than the code you're trying to push to it.
you have to do a pull and update your own working repository then push again, or just force a push
git pull heroku master
As a side note, if you aren't familiar with all the git commands, I would recommend you use a GUI as it may make the whole process a lot less overwhelming.
There are plenty of great clients here: http://git-scm.com/downloads/guis