Why Rails server getting shut down automatically?

March 14, 2016 1.2k views
PostgreSQL Ruby on Rails

We are using rails 4 and we are facing problem of 502 gateway error. Many time rails server automatically shut down and database connection (postgresql) disconnected.

1 comment
  • There are a ton of reasons why a Rails script could crash. You will need to review your logs or implement some error handling in your script to log these events. There are several ruby gems out there that will help you easily add logging and crash reporting to a ruby script. Without further information (a 502 error is just nginx saying that the Ruby process is no longer listening at the port where it is looking for it) it won't be possible to narrow down a specific cause.

1 Answer

This question was answered by @ryanpq:

There are a ton of reasons why a Rails script could crash. You will need to review your logs or implement some error handling in your script to log these events. There are several ruby gems out there that will help you easily add logging and crash reporting to a ruby script. Without further information (a 502 error is just nginx saying that the Ruby process is no longer listening at the port where it is looking for it) it won't be possible to narrow down a specific cause.

View the original comment

Have another answer? Share your knowledge.