1) Create a simple Rack app that uses Puma
2) Run bundle exec puma -p 8080
It should listen on 8080 port I provided via command line option.
Puma listens on tcp://0.0.0.0:3000
Ruby version: 2.4.0p0
Rails version: 5.0.1
Puma version: 3.7.0
When running with rails server command:
โฏ bundle exec rails server -p 8080 -b 0.0.0.0
/Users/premist/.gem/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/Users/premist/.gem/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
=> Booting Puma
=> Rails 5.0.1 application starting in development on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
/Users/premist/.gem/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
Puma starting in single mode...
* Version 3.7.0 (ruby 2.4.0-p0), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
When running with puma command:
โฏ bundle exec puma -p 8888 -b 0.0.0.0
Puma starting in single mode...
* Version 3.7.0 (ruby 2.4.0-p0), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
/Users/premist/.gem/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/Users/premist/.gem/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
/Users/premist/.gem/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Fixed on master, releasing in 3.7.1.
For newbies (like me) simply edit your Gemfile.
By default(*) you should see something like:
# Use Puma as the app server
gem 'puma', '~> 3.0'
Replace the puma version as:
# Use Puma as the app server
# gem 'puma', '~> 3.0'
gem 'puma', '~> 3.7.1'
Then run following command under your rails application's root directory, for puma v3.7.1 to take effect:
bundle install
This indicates; 3.7.1 <= Puma version < 4.0 is OK for your application. Beautiful! :-)
(*) Of course that default value should change as rails evolve by time. So this post should be useful "nowadays".
I had the same problem with puma 3.7
Solved with above comment
in Gemfile
#gem 'puma', '~> 3.7' # commented
gem 'puma', '~> 3.7.1'
and then on console:
$bundle install
Thanks
Most helpful comment
Fixed on master, releasing in 3.7.1.