Rails 6: Introduces explicitly adding rails server handler option


Rails 6 adds rails server handler option, to specify the server (webrick/thin/puma…) we want to use.

Before Rails 6

The rails server --help signature looked like this

rails server [puma, thin etc] [options]

To start rails server using thin we needed to execute below command

$ bin/rails server thin

We were not specifying any explicit option for the rack server we intended to use.

In Rails 6

Now we need to specify the handler --using or -u for the rack server.

The new command is

$ bin/rails server --using thin

or

$ bin/rails server -u thin

The above changes also notify error message if a missing or mistyped rack server name is specified.

So if tin is passed instead of thin as rack server

$ bin/rails server -u tin

It will throw an error denoting mistyped rack server

Could not find server "tin". Maybe you meant "thin" or "cgi"?

Run `rails server --help` for more options.

In case a server which is not present in Gemfile is passed

$ bin/rails server -u unicorn

It will throw below error denoting missing rack server

Could not load server "unicorn". Maybe you need to the add it to the Gemfile?

  gem unicorn

Run `rails server --help` for more options.