mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
c24c0c8834
This issue is somewhat tricky. When Rails is booted via `rails server` there are two types of configuration options passed, ones specified directly by a user like `rails s -p 3001` will always "win".
For any other config that is not explicitly passed in, puma will consider it a "default". For example when you run `rails s` (without -p) then the default port will be 3000.
There is one other way to configure puma though, and that is via a config file:
```
# config/puma.rb
port 3002
```
This is the order of precedence for configuration
1) Anything the user explicitly passes to `rails s`
2) Config specified in `config/puma.rb` file
3) Default values passed in via `rails s`
4) Defaults values stored in puma
This fallback mechanism works well except in the case of calling `port` in a `config/puma.rb` file. To understand look at the [old method definition](
|
||
---|---|---|
.. | ||
handler |