Heroku open gives a 404 - ruby-on-rails

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

Related

Heroku and Rails: App pushes successfully but nothing appears in heroku app

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.

No errors, no problems, nothing showing up

I've spent a solid amount of time on this and I've lost faith in my Heroku abilities.
I have a rails app
I've migrated the database
I've included the rails12_factor gem in production
I have the Heroku toolbelt
I've logged in with my credentials via the terminal
I've created a heroku app with the command "heroku create blahblahblah"
This gave me my remote
I've used 'init' 'add .' 'commit' and everything is up to date
I've deployed with 'git push heroku master'
My app was deployed successfully without any problems
It tells me everything is up to date
My production check says everything passes
I can't for the life of me bloody well figure out why, when I go to my app's URL that it only shows the welcome page "Heroku | Welcome to your new app!"
I'd be forever greatful and in your debt to whomever can help me with this.
In older versions of rails you had to delete the index page from the public directory.
I think in rails 4, you need to define a route for root.
so in your config/routes.rb some thing like :
root to: 'static_pages#home'
Do you have this problem only on Heroku? what happens on localhost:3000?

Pages now showing after pushing to heroku

I've succesfully submitted my app to git, and then pushed it to heroku. Starting page working as it has to, but the rest with path heroku_site.com/pages/page_name says me "We're sorry, but something went wrong." Same pages works fine on local server.
Any ideas whats wrong?
inb4 routes are fine(and rest too, rspec spec/ green)
You can view your Heroku logs with $ heroku logs
Looking at your routs, I'd guess that your page is based on content in your local database that you have not added yet to your production database.
If so, you can either push your local database to production $ heroku db:push
Or you can put that data in a Rails migration or seed it. Or you can go create it in your production app.
In general, to find out what you can do: $ heroku help

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.

Why doesn't Heroku show the default Rails page?

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?

Resources