Will
Will

Reputation: 347

Why does my demo app on Heroku only show the "Welcome Aboard" page

Note: I have spent the morning carefully checking the similar questions on this subject but it has not helped.

My Question

I am following Michael Hartl's Ruby-on-Rails tutorial. The first demo app runs nicely. It shows "Welcome Aboard" and when I add /users it runs the demo app. I pushed it to Heroku and it runs there but only shows the Welcome Aboard page.Adding /users gets "The page you were looking for doesn't exist.". I did not change any routes. It seems I should be able to view my demo app at this point on Heroku. I'm surprised because the tutorial is very thorough.

Further Experiments

I deleted public/index.html. And removed it from git and committed it and verified with git status. When I try to open localhost/3000 I get "Routing Error" as expected. When I add /users, the demo app works as expected. I did not change routes.rb. I was not instructed to in the tutorial.

Now I push to Heroku and open my application there I now get "The page you were looking for doesn't exist." That seems right. The same as if I opened localhost/3000 when running locally. But when I add '/users' at Heroku I still get the page error. Do I need to add a route? This is not mentioned in the tutorial (or I overlooked something).

Thanks for help for this newbie to Rails.

More Info

I did add a route to point to users/index which now makes my localhost version open right up to the application without having to manually add users onto the URL. But when fully committed and pushed to heroku I still get a page error.

Here is the output from rake routes:

~/Documents/demo_app: rake routes
users       GET    /users(.:format)          users#index
            POST   /users(.:format)          users#create
new_user    GET    /users/new(.:format)      users#new
edit_user   GET    /users/:id/edit(.:format) users#edit
user        GET    /users/:id(.:format)      users#show
            PUT    /users/:id(.:format)      users#update
            DELETE /users/:id(.:format)      users#destroy
root                                         users#index

Upvotes: 0

Views: 2519

Answers (1)

Dipak Panchal
Dipak Panchal

Reputation: 6036

try this

heroku run rake db:create
heroku run rake db:migrate

run your application

# in your terminal write
heroku logs -e production

it will display error in your terminal, so that you can easily understand.

Upvotes: 2

Related Questions