Heroku and Rails: App pushes successfully but nothing appears in heroku app - ruby-on-rails

I am trying to learn how to push to Heroku. I created a brand new Rails app using postgresql
rails new p3 -d postgresql
and followed all instructions exactly as they are on herokus help page.
git init
heroku create
git add .
git commit -m "rails new p3 -d postgresql"
git push heroku master
run rake db:migrate
When I perform the heroku opencommand it directs me to a page that says "The page you were looking for doesn't exist". Furthermore, When I check my code under heroku personal apps, the app name shows up but none of the code appears.
I have no idea what to do next. What do I do when my code pushes successfully, but nothing appears in my heroku app?
EDIT:
Activity feed shows I am pushing, but still nothing changed in code:

After checking my logs by typing heroku logs --tail I realized I was receiving an error message because my routes were not setup. Setup a basic get '/' route and it will work correctly.

Related

Heroku app removal

Rails 4 application.
Using Cloud9 editor (Not AWS)
Question:
I was getting several errors in my Heroku app when I tried to push my completed work. It was showing a Segmentation fault error. My mentor suggested I delete and recreate the app and try to redeploy. Like the noob that I am, I deleted the application from my Heroku repository instead of destroying it in my Rails console. I proceeded to with a heroku create command and created a new app. However, when I went to git push heroku master it references the old app and gives a fatal: repository 'https.....' not found error.
How do I destroy the old app when the repository is still referenced/embedded in my code. Any suggestions would be greatly appreciated.
from your command line, execute heroku apps:destroy
if it doesn't work, check your Git remote repository list by executing git remote -v
if there is "heroku" in the one of the list, then delete it by git remote rm heroku
and then create new Heroku app as what you do usually

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.

How to reset everything Heroku in my Git/Rails 3.1 Project

I solved my problem while writing this post, but I thought this might be good information for other noobs like me :)
To solve the problem below edit the following file
.git/config
There's a section that looks like this
[remote "heroku"]
url = git#heroku.com:adjective-noun-1234.git
fetch = +refs/heads/*:refs/remotes/heroku/*
This is what git tries to push to. Just change the line
url = git#heroku.com:adjective-noun-1234.git
to whatever new Heroku project you created. Git should now be able to push to Heroku again.
I have gotten my second Rails app ever to a working state and want to deploy it. So I followed all the steps for Heroku deployment in the Ruby on Rails Tutorial (I had the deployment working for the sample app from the book) using:
heroku create
I then push my project with
git push heroku master
The project doesn't work although I can't find any errors in the Heroku logs, all I get is:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it
shortly.
So I looked around the Heroku Support Section and found the official Rails 3.0 / 3.1 deployment guide:
http://devcenter.heroku.com/articles/rails3
http://devcenter.heroku.com/articles/rails31_heroku_cedar
I went to the Heroku Web Frontend > General Info > Destroy App because I wanted to continue my efforts with a clean slate.
Following the guide I created a Heroku project for the cedar stack:
heroku create --stack cedar
And push it to Heroku using
git push heroku master
THE PROBLEM: for some reason git is still trying to push to the old Heroku project!!!
resulting in an error
fatal: The remote end hung up unexpectedly
Check your remote repositories, and update it to the new heroku name:
git remote -v
Then remove the heroku one that is wrong:
git remote rm heroku
Then add the new one
git remote add heroku git#heroku.com:sitename.git
This is a bit extreme, but worked for me....
heroku destroy appname
heroku create
git push heroku master

Why are certain aspects of my Rails app throwing an exception publicly when I deploy to Heroku?

I am working my way through Michael Hartl's Ruby on Rails Tutorial (on Mac OSX 10.7.2/Ruby 1.9.2/Rails 3.1.1) and just finished Chapter 2, which concludes with deploying a demo twitter app to Heroku.
Everything appears to be working properly when I run the app locally AND I was able to successfully deploy the app to Heroku in some capacity because it is available here: http://rich-twitter-baby.heroku.com/
However, what I can't figure out is why the /users and /microposts pages aren't showing up publicly (with lists of users and microposts respectively) as they do locally. I migrated my database to Heroku and pushed the info up there and everything seemed to work properly, but I get this error message when I try to view the pages publicly.
I've tried running "heroku console" but get this error:
Unable to attach to a dyno to open a console session.
Your application may have crashed.
Check the output of "heroku ps" and "heroku logs" for more information.
And the logs say error H13, while the ps looks like this:
Process State Command
------------ ------------------ ------------------------------
web.1 idle for 1h thin -p $PORT -e $RACK_ENV -R $HER..
Let me know if anyone has any ideas or if more info would help.
Thanks!
I would contact Heroku support on this. Dynos can crash and become 'zombiefied' which means they just sit there idle.
Normally these will clear themselves out within a few hours, but it shouldn't happen that often if at all.
Doing a new deploy will also normally restart everything back to clean.
If it's consistently happening, have you tried spinning up the application locally in production mode to try and reproduce the problem
rails server -e production
, or adding something like the Airbrake add-on to your app to capture the error.
Check your log using
$> heroku logs
At the command line of your development system that you used to push to heroku.
Post the log here if you can't figure it out from that.
I contacted Heroku Support about this issue and it turns out that the answer had to do with which stack my app was being deployed to. I did their workaround and everything is now up and running. Here's the full info from them:
It looks like the problem is that you're using Rails 3.1 and our Bamboo stack; we have full >asset pipeline support on our Cedar stack[1]. Since this is just a demo app, an easy >workaround is to precompile locally and commit the files:
rake assets:precompile
git add -A
git commit -m "precompiling assets"
git push heroku master
To get full asset pipeline support, you need to create your app on the Cedar stack and then >repeat the process you did to get your Bamboo app to work.
[1]: http://devcenter.heroku.com/articles/rails31_heroku_cedar

Resources