Today I Learned

A Hashrocket project

Start rails with a different web server

The webserver for my current project is puma, which is a multi-threaded ruby server. This multithreaded nature makes it hard to but a pry statement in and break in specific places. There are multiple threads that will listen to the input the user provides at the REPL.

Using webrick would allow us to debug and step through our code but changing the applications configuration in order to enable that seems unreasonable.

Fortunately, rails provides an easy way to change servers at the command line.

> rails server webrick

Just pass the name of the server you would rather use as a command line argument.

When typing rails server --help you'll see this option available on the first line:

Usage: rails server [mongrel, thin etc] [options]

Looking for help? Hashrocket provides expert Ruby on Rails development. We’ve built hundreds of high–quality Ruby on Rails applications over the past decade. Contact us today and find out how we can help you.