Make the error display on the browser the same in development and production environments
First, when ERROR occurs in the development environment, detailed information will be displayed in the browser.
However, in the production environment, “We’re sorry, but something went wrong.” is displayed even if some kind of ERROR occurs.
So to display detailed information in the browser even in the production environment
config.consider_all_requests_local = false to
config.consider_all_requests_local = true
Reset DB in production environment
In the production environment of Rails 5 or later, a function to prevent the execution of commands such as db:drop and db:reset that destroy the DB has been added.
Therefore, an error will occur even if you execute
bundle exec rake db:migrate:reset RAILS_ENV=production in a production environment.
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 in the environment variable.
$ bundle exec rake db:migrate:reset RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1
Settings under Rails config/enviroments that you should know
You may find the clue of the solution when you get stuck in the production environment by going through the following sites. Read under Rails config/enviroments