Puma is a web server that can be used in Rails Production and Development environments. It is the default server for Rails 5, but if you’re using an earlier version, it needs to be installed. Although the regular Rails server works fine, Puma is recommended if you’re going to be deploying your app to Heroku.
In the gem file add
Create a Procfile in your app folder (must be capitalized), after it’s created it should be listed below the vendor folder in your text editor.
In Procfile add
web: bundle exec puma -C config/puma.rb
In your config folder create a file called puma.rb
In puma.rb add
workers Integer(ENV['WEB_CONCURRENCY'] || 2) threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5) threads threads_count, threads_count preload_app! rackup DefaultRackup port ENV['PORT'] || 3000 environment ENV['RACK_ENV'] || 'development' on_worker_boot do # Worker specific setup for Rails 4.1+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot ActiveRecord::Base.establish_connection end
In your terminal run bundle install
Restart your rails server.