13

I'm following this Rails tutorial. When I run rails server locally, I can see the "Welcome Aboard" page. However, when deploying to Heroku, it shows "The page you were looking for doesn't exist." I've searched around but couldn't find anything to solve my problem. Below are my steps:

rails new first_app  

Make this change to Gemfile:

group :production do
    gem 'pg'
end

group :development do 
    gem 'sqlite3' 
end

Then,

bundle update
bundle install
bundle install --without production
rake assets:precompile

git init
git add .
git commit -m "initial commit"

heroku login
heroku create
git push heroku master
heroku open

At this point it opens the address for the heroku app and gives the "doesn't exist" error. When checking 'heroku logs' it shows the status=404 of my visit: heroku logs

Aaron
  • 1,693
  • 4
  • 26
  • 40
  • Did the app deploy successfully? – aarti Feb 25 '14 at 21:25
  • @archie It says http://shrouded-brook-5034.herokuapp.com deployed to Heroku. There are some warnings though. For example, "Include rails_12factor geme to enable all platform features", "You have not declared a Ruby version in your Gemfile", "Removing Gemfile.lock because it was generated on Windows". – Aaron Feb 25 '14 at 21:39
  • I included gem 'rails_12factor' for group :production and did the bundle update/install and pushed to Heroku again. It didn't affect anything but the warning is gone. – Aaron Feb 25 '14 at 21:40
  • what does your `rake routes` output looks like? do you have a `root to:` somewhere? –  Feb 25 '14 at 21:54
  • No, I don't have any routes defined yet. The tutorial indicates that it should still show the default page. If routes are required, then it might be their mistake. – Aaron Feb 25 '14 at 21:57
  • 1
    the default 'welcome aboard' page shows up if you don't have any routes defined. I'm not sure the same behavior applies on Heroku. –  Feb 25 '14 at 22:01

1 Answers1

39

Beginning in Rails 4, the "Welcome Aboard" page is no longer a static page located in the public directory, it is a smoke page located within the Rails framework itself. This page will only be shown in the development mode, so when you've deployed to Heroku and are running in production mode, you won't get an automatic start page. You'll need to add a root route otherwise you'll get the error you are seeing.

see: Where is the default "Welcome Aboard" page located in my app?

Community
  • 1
  • 1
Carlos Ramirez III
  • 7,314
  • 26
  • 33
  • Yeah, I was beginning to suspect this after @user2062950 comment above. Thanks for the clarification. – Aaron Feb 25 '14 at 22:22
  • I already have a root route and I'm still getting this problem but only in production. EDIT: This was because I had authenticated a user then deleted it from my database before logging out. – IIllIIll Dec 01 '15 at 16:28