** Introduction ** I was messed up with a 500 Internal Server Error while creating a portfolio in Rails and would like to share with you how to solve the problem.
Maybe due to the asset pipeline
I've been developing in the development environment for a long time, and the application has been completed to some extent, so when I tried to deploy it in the production environment in the production environment, I got ** 500 Internal Server Error ** and could not solve it for 3 days. ..
--Changing the settings of the conf file of the web server (Nginx)
=> Not resolved --Around the socket such as deleting the puma socket
=> Not resolved --Review of other parts that may be related such as database.yml and Gemfile
=> Not resolved --Check the contents of production.log
=> Check for errors around the asset pipeline
--First clean the asset pipeline with
rake assets: clobber
bundle exec rake assets: precompile RAILS_ENV = production to precompile the asset pipeline
=> In my case, I was asked to install yarn, so install it. ――It started up well after restarting
=> In my case here was also done.
At first I decided it was a problem around the web server, but I should have looked at production.log from the beginning to see the error. It was a very educational error resolution.