rails: Rails server doesn't start Puma on the correct port
After upgrading to Rails 5.1, running rails server
no longer starts the server on the default port of 3000 on my project. Weirdly it prints that it is starting on port 3000, but Puma is booted up on port 9292. If I pass the port number it works correctly.
I’ve tried creating a new Rails project, but can’t reproduce it, so it must be something strange with my configuration, but I have no idea what it could be (it’s a private project so I can’t share it).
Steps to reproduce
Run bundle exec rails server
Expected behavior
Server should be started on port 3000.
Actual behavior
Server is started on port 9292.
=> Booting Puma
=> Rails 5.1.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
W, [2017-05-03T14:52:33.021141 #25863] WARN -- : DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from <top (required)> at /home/luca/code/paytouch/pt_dashboard/config/initializers/callback_terminator.rb:5)
Puma starting in single mode...
* Version 3.8.2 (ruby 2.4.1-p111), codename: Sassy Salamander
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:9292
System configuration
Rails version: 5.1 Ruby version: 2.4.1 Puma version: 3.8.2
Diff of Gemfile changes (the only thing that has changed) after upgrading from Rails 5.0.2 to 5.1: https://gist.github.com/lucaspiller/02be631352812417e5d4ffb4ce8e9044
config/puma.rb:
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 9
- Comments: 18 (9 by maintainers)
Commits related to this issue
- make puma boot on the correct port in dev see - https://github.com/puma/puma/pull/1277/files - https://github.com/rails/rails/issues/28971 — committed to zendesk/samson by grosser 7 years ago
- Update Puma to fix Rails default boot port Puma 3.8 has know bug which cause Rails server to start on port 9292 instead of 3000 (rails/rails#28971). Possible solution is to explicitly specify expose... — committed to IT61/it61.info by vtambourine 7 years ago
- Update Puma to fix Rails default boot port Puma 3.8 has know bug which cause Rails server to start on port 9292 instead of 3000 (rails/rails#28971). Possible solution is to explicitly sp... — committed to IT61/it61.info by vtambourine 7 years ago
- Update Puma to fix Rails default boot port Puma 3.8 has know bug which cause Rails server to start on port 9292 instead of 3000 (rails/rails#28971). Possible solution is to explicitly sp... — committed to IT61/it61.info by vtambourine 7 years ago
- Update Puma to fix Rails default boot port (#176) Puma 3.8 has known bug which causes Rails server to start on port 9292 instead of 3000 (rails/rails#28971). Possible solution is to explicitly speci... — committed to IT61/it61.info by vtambourine 7 years ago
Since Puma 3.9 was released, updating Puma solves the original issue.
Confirmed, upgrading to puma definitely solves this issue.