Deployed to EC2 with Rails6 + Puma + Nginx And at the terminal SSH connected to EC2
rails s -e production
Then the service is displayed without any problem
rails s -e production -d
Then the error screen is displayed?
It's for you who have troubles!
In config / puma.rb in the Rails root folder
config/puma.rb
daemonize
I will add it! with this
rails s -e production -d
I can't start it
rails s -e production
This will make it a daemon, so it's a solution!
People who think that this is inconvenient even locally as a daemon
config/puma.rb
if Rails.env == 'production'
daemonize
end
Let's write! It's a workaround that anyone can think of! I'm sorry to write it as I knew it!
I haven't completely investigated it, but as a result of becoming a net surfer and diving in the sea of google, it seems that puma.rb is not loaded when it is daemonized with "rails s -d" in puma. When I started with rails s -e production -d, I could not connect to the Nginx error log with the socket set in puma.rb! Because it is described, I think that it is probably correct.