How do I get 'puma' to start, automatically, when I run `rails server` (like Thin does) How do I get 'puma' to start, automatically, when I run `rails server` (like Thin does) ruby-on-rails ruby-on-rails

How do I get 'puma' to start, automatically, when I run `rails server` (like Thin does)


After some digging, I've found this answer: https://stackoverflow.com/a/14911994/604526

To make Puma the default, paste this code into script/rails above require 'rails/commands':

require 'rack/handler'Rack::Handler::WEBrick = Rack::Handler.get(:puma)

Puma is the default server now if you use rails s

rails s=> Booting Puma=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000=> Call with -d to detach=> Ctrl-C to shutdown serverConnecting to database specified by database.ymlPuma 1.6.3 starting...* Min threads: 0, max threads: 16* Environment: development* Listening on tcp://0.0.0.0:3000

Rails 4

With Rails 4 you simply have to add the puma-gem to the Gemfile. (Tested with Rails 4.0.2 and Puma 2.6.0)


At least in Rails 4, you just need to add the following to your Gemfile

gem 'puma'

then run 'bundle', and then when you run 'rails server' and Puma will be used.


This works for me. Ruby 2.0.0 Rails 3.2.13 Puma 1.6.3

rails s puma