Memj
Memj

Reputation: 161

Opening Heroku | Page not found

I'm following this tutorial to a tee and so far so good. I ran into a problem on step 2.6

On my terminal I input

 heroku open

After which it opened a new webpage on Chrome.

The terminal then displayed

 Opening aqueous-forest-3891... done

The webpage that opened was https://aqueous-forest-3891.herokuapp.com/ and unfortunately it says the webpage may have been moved or does not exist.

I've followed the tutorial exactly (as far as I can tell) and can't figure out what I've done wrong. I'm very new to Rails (and Ruby....and Heroku...).

I'm not exactly sure how to troubleshoot my problem or if there's a command I can use in my terminal for debugging - etc.

Upvotes: 1

Views: 3975

Answers (3)

Rajan Verma - Aarvy
Rajan Verma - Aarvy

Reputation: 2117

In my case I deployed custom branch to heroku master, which; heroku usually does not build itself. If you want to deploy custom branch to heroku use this command.

git push -f heroku your_branch_name:master

Upvotes: 0

Richard Peck
Richard Peck

Reputation: 76784

Good news: a Rails error means your app is running on the server

Bad news : your routes are likely causing a problem.

According to this blog (which has exactly the same issue), the problem is that Heroku won't host the "default" Rails page. You'll need to create a default page & redeploy:

#config/routes.rb
root "application#index"

#app/views/application/index.html.erb
Hello world

$ git add .
$ git commit -a -m "Default Page"
$ git push heroku master

Context

The error you're seeing is one from Rails:

enter image description here

This is good, as it means your Rails app is actually on the Heroku server & being picked up. This type of error is either suggestive that you have an error with your server (500 error), or a missing page (404 error).

-

If you had the following error, it would be a Heroku (platform) centric issue:

enter image description here

This is normally caused either by a lack of database connectivity, or some sort of environment issue (ENV vars missing etc).


The best way to debug Heroku is to use the Heroku logs.

These are written - as with most event-based software - on the server, allowing you to see what's going on. Heroku recently upgraded their software to include a new real-time logging system:

enter image description here

Checking in there will tell you what's going on, allowing you to take direct action to resolve it.

Upvotes: 3

margo
margo

Reputation: 2927

To debug your issue you will need to view the logs. A quick way is to add the Papertrail add on to your app (there's a free option). Add-ons can be added via the resources tab from Heroku.

Another option is to to view the heroku logs in the terminal with the command

heroku logs -t --app appName

By viewing the logs, you should get some error messages that will help you debug why your app isn't showing.

Upvotes: 0

Related Questions