Even if you deploy an application developed with Rails to Heroku, the following screen will appear. As soon as I seeded it on Heroku, I couldn't open it.
When I checked the error on heroku logs, it was as follows.
ActionView :: Template :: Error (Couldn't find Result with'id' = 2):
Completed 500 Internal Server Error in 141ms
Looking at the error, the routing was the problem.
ActionController :: RoutingError (No route matches [GET] "/ results"):
What I checked
No route matches [GET] "/ posts" error resolution example
https://qiita.com/KONTA2019/items/b75f940399506dfe8430
When I checked the routing description, it was normal.
routes.rb
Rails.application.routes.draw do
root to:'results # index'
get'results /: id', to:'results # win_or_lose'
end
The index action in the results controller should show a view of index.html.erb, but I don't know why.
I tried resetting the database in an attempt to withdraw the seed.
heroku run rake db: migrate: reset
However, a sentence that seems to be an error came out.
Running rails db: migrate on ⬢ sugar-league ... up, run.3929 (Free)
DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use ʻActiveSupport :: LoggerSilence` instead (called from<main>at /app/config/application.rb: 7)
I migrated again.
heroku run rake db: migrate
Running rake db: migrate on ⬢ sugar-league ... up, run.4699 (Free)
DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use ʻActiveSupport :: LoggerSilence` instead (called from<top (required)>at /app/config/application.rb: 7)
After all, it has not been migrated properly. I would like to know the possible causes and remedies.
-
Answer # 1
Related articles
- ruby on rails - after deploying, the database defalut setting is 0
- ruby on rails - after installing devise on rails6, routing error occurs, so i want to eliminate it
- ruby - after rails db: migrate: reset, the database disappeared
- ruby on rails - when i access the rails 6 site on heroku with my own domain, it says "this connection does not protect priv
- ruby on rails 5 - after overwriting the image under assets, nothing is displayed
- ruby - unable to access server with rails s
- ruby on rails - menu switching does not work well after logging in with rails + devise
- ruby on rails - seed fails on heroku
- ruby - rails s fails to start the server with a usage: rails new app_path [options] error
- ruby on rails - after updating to rails6
- ruby on rails - it is not saved in the database after registering the product
- ruby - i can't transition to my page for each user after logging out (rails)
- ruby on rails 6 - even if i look at routesrb, i do not know which url to access to display the screen
- [ruby on rails] the page is not displayed after connecting to the server on aws cloud9
- ruby on rails 5 - rails: unique constraints after creating a migration file
- ruby on rails - [rails] after customizing the devise controller, new registration is not possible
- ruby on rails - rails not updated after editing update
- ruby on rails - unable to access localhost with rails6 and docker
- ruby on rails - csrf fails even though authenticity_token is embedded in the parameter
- javascript - jquery doesn't work on heroku
- ruby on rails - "this connection does not protect your privacy"
- ruby - i want to eliminate herokun deployment errors
- ruby on rails - [rails] google oauth authentication cannot log in in production environment
- ruby - image is not reflected on heroku
- ruby on rails - seed fails on heroku
- ruby - rails tutorial chapter 2 (6th edition)
- ruby on rails - heroku: how to check the database_url used for regular backup
- css - background-image is not reflected on heroku
Heroku had ids added every 10th.
With reference to the following, I operated the DB from Sequel Pro and completed it.
https://t.co/OdM9gplcV2
The lack of id = 2 was a hint.