Heroku and Git are not updating, pushing, or pulling properly - ruby-on-rails

I'm literally falling apart at the seams with angry, nervous laughter. Someone PLEASE help me...
Screenshots: https://medium.com/p/4ff0a5af7f53
Run git status, I am on working branch Redesign with nothing to commit and a clean working directory.
Run rails server and navigate to localhost:3000. Yay pretty website, let's just denote it with a variable ABC
Run git push heroku Redesign:master, it tells me everything is up to date
Navigate to the website... it shows me a website that's totally different, XYZ, from several months ago
Ok, so I'm going to humor this, I'm going to navigate to a new branch Rollback and run a git pull from Heroku
Now on this Rollback branch I'm going to run rails server expecting to see the XYZ old site that I just pulled from Heroku
False, I instead get ABC (and the Sublime code shows the code for ABC as well)
By the way running the push with --force does not help. When I run heroku releases there is no record of this push.
WHAT IS HAPPENING????????
Sorry if I seem desperate... I've been at this for 2 hours

Ok this was dumb of me, #Chris I think you were going to stumble upon it. I had done a heroku rollback and didn't realize that when you rollback on Heroku, the git repo head commit doesn't change.
This is the thread that solved it: heroku rollback didn't update the HEAD remote branch, did it?

git add .
git commit -a -m "Message"
Have you performed these before you try and push? You have to update your local git repo before sending to Heroku

Related

Heroku deploying old version

I am fairly new to rails. I originally deployed a rails app on Heroku. I decided then to delete that app from the heroku website and then created a new heroku app using the same original file on my computer. I changed a few styles, but otherwise it's the same code. Whenever I do a git push heroku master now, it updates the new app with the old version. I am practically ripping my hair out. I've done
git remote -v
and it seems to be sending my code to the new source. But it's not! It keeps giving me the display from the older version. It seems to be pulling from a different source than what I am pushing to. Can someone help me?
Maybe you forget commit your changes or they aren't in master branch. Use this commands for diagnosis:
git status
git log heroku/master..master
git branch -a

Changes show up locally but not on Heroku

I've tried a bunch of different things as per suggestions, but cannot get it to work for me, what are some more alternatives?
When I git push, it says its already updated... is it a problem with uploading gem files, css? How can I know where it starts so I can then find an answer. It hasn't recorded any of my git push heroku master commands for a while apparently because there are many things missing & I just found out... Help!!!!
I'm pretty new at this, sorry guys!
You've got to run this from the command line:
git add . # Adds all files into the git
git commit -a -m "Your commit" # Creates commit
git push heroku master # Pushes commit to Heroku
This will put your latest version of code onto Heroku, and then you've got to ensure you've got the database connectivity sorted (so your data updates persist in production)
The problem was in passing a non-matching command to set my amazon bucket to what was on my production environment. Tutorial & huroku development center differed in syntax so I mixed them up apparently. So nothing after image uploading stage would work, all fixed now though! Thx

starting with heroku; fail updating rails app

after a few months learning a bit about rails and making some stuff local, I wanted to try to upload a simple rails app to heroku. Which, by the way, was a pain in the ass because of installing issues of Postgresql. But ok, that's done.
Now I create an app on heroku, I did the login, key thing, git, and uploaded. Was fine, very easy after all. I just uploaded an empty rails app, to try heroku.
Well, then I add a controller. Upload again via git push heroku master and not so fine! I did scaffold, for my articulo controller. And I wasn't able to open the URL once pushed to heroke on someurl/articulos. I got an 404 heroku message here: http://enigmatic-scrubland-8865.herokuapp.com/articulos
Then I create a controller for the home site and get rid of the "welcome aboard" default site. Again push heroku... On terminal I got messages all updated, and lauching. All fine.
But then I access and again, the "welcome aboard" default page.
Locally it works fine. But now I'm not sure if I'm doing it well. It scares me that no failing messages are to see nowhere, but obviously it fails.
After editing my rails app, I always do this:
$ git init
$ git add .
$ git commit -m "init"
$ git push heroku master
Like the documentation says on heroku. But, no error and no updating.
Thanks in advice.
From what I see from heroku devcenter, the git init part is only to be done on the first initial creation of the git repo, not "After editing my rails app".
In other words, you shouldn't have to "always do" a git init after editing your rail apps.
For the first push, I would recommend a:
git push -u heroku master
That way, all the subsequent push will be a simple:
git push

Ruby on Rails: Pushing to heroku - keys error

I have recently moved my app from a linux machine to windows, and I am trying to set it up with heroku again. There are problems with my keys, so I am just wanting to push the app up as a brand new app.
I do, git init, then git add ., then git commit -m "init", and now I do heroku create.
I want to just push my folder up to the new app cedar, but everytime I run git push heroku master is tries to push to the old one, and an error flags as my keys don't match.
Anyone have any ideas? Thanks
Execute heroku auth:logout to logout, then heroku auth:login to login again.
To read full help message, try
heroku help
heroku auth
It seems that you're calling heroku apps:create wrongly? Take a look at the documentation here.
Also, the deployment documentation might be more useful for you if you already have a git repository setup.

rails app in development doesn't show up on heroku

Im developing a rails app. Following this tutorial here:
Tutorial
I finished a part and wanted to push all the changes up to heroku and view them there. I can view the site on my local machine. On heroku all I see is this:
I typed in the following commands after I made my changes, saw the site was working on my local computer.
$ git add .
$ git commit -m "Finish layout and routes"
$ git checkout master
$ git push
$ git push heroku
$ heroku open
I even looked at the heroku logs but couldn't make sense of whats going wrong! There is no content in my database, its empty. I just have views setup.
Why did you checkout to master? Are you working on another branch?
If that is the case, you will need to merge your changes to master before pushing your code (supposing you are on master which is already the case after the checkout):
git merge other-branch
Also don't forget to migrate your database on heroku.
heroku rake db:migrate
EDIT
To find out your current branch, type:
git branch
It will mark the current branch with a '*'.
If you have removed the public/index.html file, you'll have to do git rm public/index.html as well, then commit and push to Heroku. If you delete a file locally, git won't pick up on that without doing the git rm, and Heroku's knowledge of your app is 100% through Git.
I had a similarly strange (but unrelated) problem when I had an app that was storing uploaded files on Heroku. Every time I'd do a push they'd all go away. It confused me greatly until I realized that Heroku essentially wipes every time you do a push, and anything that isn't in git isn't kept. A good reason to use S3 or similar for uploaded file storage.

Resources