- Read Tutorial
- Watch Guide Video
In this guide we are going to walk through the process of installing the puma web server.
Puma is one of the most popular and powerful web servers available to Rails applications. Typically I prefer to use it for my apps because it is faster and handles threading considerably better than the other options such as WebBrick
.
In order to get this working, all that we have to do is install the Puma
gem, and then we can run rails with it.
Start by going to the Gemfile
and include Puma
, like this:
# Gemfile gem 'puma' , ' ~> 3.4'
Now, run bundle
in your console to get all the dependencies in place.
And that's it, Puma
is now installed. To run it we can use the command:
rails s Puma
When Puma
starts, it lists a number of commands about the version and environment. For right now we don't have to worry much about any of these but it's good to know that they are there.
If you check out the browser you'll see that everything is working properly. Also, in the future we can simply run rails s
and it will automatically run the Puma
server for us.