Heroku shows "The page you were looking for doesn't exist"

Hi Alex, I was trying to deploy my app to heroku but getting this error. I tried to access the logs file and this is what I got https://www.dropbox.com/s/727z23n92sjf0x2/iterm-screenshot.png?dl=0 I couldn't find a solution for it, could you please help me with this and see what's going on? Thanks P/s: Sorry for the long error logs

Posted almost 4 years ago by Anthony
Posted almost 4 years ago by Alex Yang

Hi Anthony,

You're seeing this issue because your Heroku app is trying to find a restaurant with an ID of 0. This could be a code issue, in which case you should check your restaurants_controller.rb file and make sure it matches that of the course. However, if you aren't seeing issues in localhost, I suspect that you have corrupted entries in your Heroku database. To fix, you may want to clear your database and start from a clean slate. You can do that by running 'heroku pg:reset DATABASE' (to clear the database) followed by 'heroku run rake db:migrate' (to run all of your database migrations). Let me know if that works.

Also in the future, for course-specific questions like this, just post a comment in the discussion thread beneath the video in question. It will help me to have the right context, and can hopefully benefit other students in the future. Thanks!

Alex

1
Posted almost 4 years ago by Anthony

Alright got it, course-specific question will be in the discussion thread next time.

I've tried to reset database but it still remain the same, however, localhost works fine. Here is the log after I reset the database

https://www.dropbox.com/s/rowducmj1rvujxx/bugs1.png?dl=0

Still not sure what have I done wrong. :(

1
Posted almost 4 years ago by Alex Yang

Try running 'heroku restart'. If you're still seeing the error, then it's definitely an issue with your code. You should double-check your controller code with that of the video - might just be a typo.

1
Posted almost 4 years ago by Albert Pak

One other thing that I could think of could be a missing environment variable - make sure you set those also if you're using any.

1
Posted almost 4 years ago by Albert Pak

Have you ran migrations?

1