Search code examples
ruby-on-railspostgresqlserverproduction-environmentpuma

Rails 5 server respond after couple of minutes in production (5 minutes)


I just installed rails server version 5, with combination gem as below

gem 'rails'   ', '5.0.0.1'
gem 'pg', '~> 0.18'
# webserver
gem 'puma'

After rebooted, it takes couple of minutes (around 5 minutes) to respond http request, it will said "something went wrong", after 5 minutes it will run Normal additional info: it has very small data, and not many gem running. I did research but still can not find any clues.

any suggestion for tracing steps, thank you.


Solution

  • First you have a typo in the "gem rails" line

    gem 'rails'   ', '5.0.0.1' 
    gem 'rails',     '5.0.0.1'
    

    Second, Puma is already pre installed in Rails 5. The specific version of Puma that it comes with is Puma Version 3.

    gem 'puma', '~> 3.0'
    

    You shouldn't have to install Puma separately.

    Third, when your server boots up for the first time it takes time to render the page. Once the server is running it should respond quick as usual.