mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
![]() 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](
|
||
---|---|---|
.. | ||
config | ||
rackup | ||
shell | ||
helper.rb | ||
test_app_status.rb | ||
test_binder.rb | ||
test_cli.rb | ||
test_config.rb | ||
test_events.rb | ||
test_http10.rb | ||
test_http11.rb | ||
test_integration.rb | ||
test_iobuffer.rb | ||
test_minissl.rb | ||
test_null_io.rb | ||
test_persistent.rb | ||
test_puma_server.rb | ||
test_puma_server_ssl.rb | ||
test_pumactl.rb | ||
test_rack_handler.rb | ||
test_rack_server.rb | ||
test_tcp_logger.rb | ||
test_tcp_rack.rb | ||
test_thread_pool.rb | ||
test_unix_socket.rb | ||
test_web_server.rb |