Run Ruby on Rails Application with Puma

First thing First,

We Should knows about the Puma Gem, which is help to run your application so Fast. Puma is a
simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications. Puma is intended for use in both development and production environments. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like Rubinius or JRuby.

Now the Question is How Puma Works and How to run Application through Puma.

Well Here is the Answer,

1. First open your rubyonrails application first and go to Gemfile. Add

gem install puma

2. Now Run Bundle command in your terminal.

bundle install

3. Third Step, Create a Procfile file in your application

Note: Type Procfile without any file name. and also remember don't forgot to add P in Caps.

4. Add this code in Procfile

puma: bundle exec puma -p 3000 -q

5. That's now go to your terminal and just find your application and type

foreman start

That's it Your application will work

14:33:18 puma.1 | started with pid 3570
14:33:24 puma.1 | Puma starting in single mode...
14:33:24 puma.1 | * Version 2.6.0, codename: Pantsuit Party
14:33:24 puma.1 | * Min threads: 0, max threads: 16
14:33:24 puma.1 | * Environment: development
14:33:51 puma.1 | * Listening on tcp://0.0.0.0:3000
14:33:51 puma.1 | Use Ctrl-C to stop

Now Open localhost:3000 and check your Application.

Comments