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

Most upvoted comments

Since Puma 3.9 was released, updating Puma solves the original issue.

Confirmed, upgrading to puma definitely solves this issue.