Closed mpptx closed 3 years ago
@kigster could you please take a look at this? I'd really appreciate it :)
I'll take a look today.
But you like, try the following:
require: false
require 'puma'
require 'puma/daemon'
I suspect that ruby is not finding the constant because it's confused about which puma.rb
the constant is defined
If this doesn't work,I'll take a look in a couple of hours .
It still does not work. That's the content of puma.rb with your suggestions applied:
require 'puma'
require 'puma/daemon'
daemonize
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
threads threads_count, threads_count
environment ENV.fetch('RAILS_ENV') { 'development' }
if ['production', 'staging'].include? ENV['RAILS_ENV']
app_dir = File.expand_path("../..", __FILE__)
bind "unix://#{app_dir}/tmp/sockets/puma.sock"
pidfile "#{app_dir}/tmp/pids/puma.pid"
state_path "#{app_dir}/tmp/pids/puma.state"
else
port ENV.fetch('PORT') { 3000 }
end
plugin :tmp_restart
The stacktrace I'm getting:
$ pumad -D
/opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/binder.rb:12:in `<module:Puma>': uninitialized constant Puma::HAS_SSL (NameError)
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/binder.rb:10:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/server.rb:11:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/runner.rb:3:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-daemon-0.1.1/lib/puma/daemon.rb:3:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-daemon-0.1.1/exe/pumad:4:in `<top (required)>'
from /opt/homebrew/lib/ruby/gems/3.0.0/bin/pumad:23:in `load'
from /opt/homebrew/lib/ruby/gems/3.0.0/bin/pumad:23:in `<main>'
same here
Could you retest with gem version 0.1.2? Thanks!
Sorry to say that, nothing changed.
$ pumad
/opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/binder.rb:12:in `<module:Puma>': uninitialized constant Puma::HAS_SSL (NameError)
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/binder.rb:10:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/server.rb:11:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-5.2.1/lib/puma/runner.rb:3:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-daemon-0.1.1/lib/puma/daemon.rb:3:in `<top (required)>'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-daemon-0.1.1/exe/pumad:4:in `<top (required)>'
from /opt/homebrew/lib/ruby/gems/3.0.0/bin/pumad:23:in `load'
from /opt/homebrew/lib/ruby/gems/3.0.0/bin/pumad:23:in `<main>'
@mpptx You are still using version 0.1.1 of the gem, as can be seen from the third from the bottom line in your stack trace:
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/puma-daemon-0.1.1/exe/pumad:4:in `<top (required)>'
If you are using a Gemfile, you should put gem "puma-daemon", "=0.1.2", require: false and run
bundle update puma-daemon`.
If you are installing the gem using the gem
command, you may need to re-install it:
gem uninstall puma-daemon --version 0.1.1
gem install puma-daemon --version 0.1.2 -N
Hope this helps. @kigster
It helped! Thank you very much!
Hi there, I'm running Rails app with the following environment:
My puma.rb's content:
When I'll launch
puma
, the server starts normally. If I'll executepumad
, the following exception is thrown:Do you happen to know what causes this and how I can make it run correctly?