2011-10-07 15:00:45 -04:00
# Puma: A Ruby Web Server Built For Concurrency
2011-10-01 16:23:20 -04:00
2011-10-07 15:00:45 -04:00
## Description
2011-10-01 16:23:20 -04:00
2011-10-04 22:56:03 -04:00
Puma is a small library that provides a very fast and concurrent HTTP 1.1 server for Ruby web applications. It is designed for running rack apps only.
2011-10-01 16:23:20 -04:00
What makes Puma so fast is the careful use of an Ragel extension to provide fast, accurate HTTP 1.1 protocol parsing. This makes the server scream without too many portability issues.
2011-10-07 15:00:45 -04:00
## License
2011-10-01 16:23:20 -04:00
2011-10-04 22:56:03 -04:00
Puma is copyright 2011 Evan Phoenix and contributors. It is licensed under the BSD license. See the include LICENSE file for details.
2011-10-01 16:23:20 -04:00
2011-10-07 15:00:45 -04:00
## Quick Start
2011-10-01 16:23:20 -04:00
The easiest way to get started with Puma is to install it via RubyGems and then run a Ruby on Rails application. You can do this easily:
2011-10-01 16:27:47 -04:00
$ gem install puma
2011-10-01 16:23:20 -04:00
2011-10-04 22:56:03 -04:00
Now you should have the puma command available in your PATH, so just do the following:
2011-10-01 16:23:20 -04:00
2011-10-04 22:56:03 -04:00
$ puma app.ru
2011-10-01 16:23:20 -04:00
2011-10-07 15:00:45 -04:00
## Install
2011-10-01 16:23:20 -04:00
2011-10-04 22:56:03 -04:00
$ gem install puma
2011-10-25 17:24:54 -04:00
## Advanced Setup
### Sinatra
You can run your Sinatra application with Puma from the command line like this:
$ ruby app.rb -s Puma
Or you can configure your application to always use Puma:
require 'sinatra'
configure { set :server, :puma }
If you use Bundler, make sure you add Puma to your Gemfile (see below).
### Rails
First, make sure Puma is in your Gemfile:
gem 'puma'
Then start your server with the `rails` command:
$ rails s puma
### Rackup
You can pass it as an option to `rackup` :
$ rackup -s puma
Alternatively, you can modify your `config.ru` to choose Puma by default, by adding the following as the first line:
#\ -s puma