Why doesn't Heroku show the default Rails page? - ruby-on-rails

Following chapter (1) of the Ruby on Rails tutorial, I was able to successfuly push the application to "Heroku" using:
git push heroku master
But, when I open the website, I get a page with the following:
App crashed
This application is temporarily offline.
If you're the administrator of this app, please check your heroku logs for the backtrace.
Why is that? And, why don't I see the default Rails page?
Thanks.

In any situation where heroku gives you an error message in production, type heroku logs into your terminal. This will usually point you in the right direction.
http://docs.heroku.com/logs-exceptions
Also check your localhost and make sure you have migrated the database if one exists.

Are you able navigate to default local rails website at http://localhost:3000 and see the defaut site?

Related

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.
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:
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:
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:
Checking in there will tell you what's going on, allowing you to take direct action to resolve it.
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.
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

Heroku application error chapter 5

Hi i am at chapter 5 of the ror tutorial and i have problems pushing it onto heroku.
there was no issues at all, with pushing, until now, when it started showing issues with no cedar app supported - even though i have already created my current app using heroku create --stack cedar
Also when i ran the domain in the browswer, it brings me to a page where it says application error.
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
can anyone help me with this? Thanks!
DB Connection
You'll be best running:
heroku run rake db:migrate
There are two types of error with heroku - either you have the standard Rails error, or the typical Heroku error (as you're seeing right now).
The heroku error is basically the result of having no connection to a workable database. Commonly, this is that you've not created the db (which is done with heroku run rake db:migrate), but is also part of not having a workable database
You may wish to consult the Heroku PostgreSQL docs on how to resolve this

Heroku open gives a 404

I'm deploying Rails on Heroku for the first time, so I accept I'm a bit of a newbie on this turf.
I installed the tool Heroku tool belt. Created a simple Rails application. Logged into Heroku. did..
heroku Create
And then pushed up the master
git push heroku master
Once the deployment is complete I tried
heroku open
I end up getting a 404. The app though runs fine on my local environment.
Heroku does not provide a standard welcome page for Rails 4. So if you did not create one yourself You will get a 404 page. This problem should not arise if your root to is properly set.
You can test this by creating a home controller with an index action, create the index. html.erb page and define root to: 'home#index'. Now heroku knows about the page and you will not receive a 404 error.
Getting started with heroku guide: https://devcenter.heroku.com/articles/getting-started-with-rails4

Why on Heroku, if I click on "About your application’s environment", it will say page not found?

Example: http://foobar-192-305.heroku.com/
If I click on "About your application’s environment"
it will say:
The page you were looking for doesn't
exist.
You may have mistyped the address or
the page may have moved.
but if I run the server in development mode on my computer, it will pop down the info. (and all files are added and committed with git, as git status shows everything committed. This app is using Ruby 1.9.2, Rails 3.0.5)
The welcome page is not ment for production. so the url where the data is loaded from doesn't exist (http://foobar-192-305.heroku.com/rails/info/properties)
It's probably because your application crashed.
In you console.
$sites/myapp heroku logs
Check those and it will tell you the erro. I bet it's because you forgot a gem file or some config like that.
I had the same problem. As I understood you should type git push heroku instead of git push heroku master. At least for me it works!

Heroku: Deploying rails application troubles

I'm trying to deploy my rails application with heroku (as shown here). I've created a very simple rails application (using ruby 1.9.2 and rails 3.0.3; i'm sure heroku supports these - see heroku docs), created and pushed github repo, created heroku repo and pushed it (all commiting is done). And when i'm trying to access my application controller, it throws 404 rails page like it's saying 'there is no such controller'. I've done heroku rake db:migrate but first time i ran it i got 'host not found' error. Running this again fixed that. Well, i'm not sure if i should run heroku addons add:postgresql - i though postgres is on by default, but heroku says i should pay in order to get DB (running command i've mentioned asks me to confirm billing it).
May be it sounds stupid, but how can i deploy my rails application (it's a very simple one) without paying any fees and such troubles as 404 pages like i mentioned in the beginning of my post? (and this is my question). Maybe i should choose other hosting (if it exists in our world) or am i doing something wrong with heroku?
You forgot to push your quotes_controller.rb to git and heroku probably.
git add controllers/quotes_controller.rb
it seems you forgot models also, and probably lot of files.

Resources