-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby 3.2 will have native IO#wait_* methods, don't require io/wait #2903
Conversation
6068201
to
0879496
Compare
…uma#2903) * detect.rb - add Puma::HAS_NATIVE_IO_WAIT * Change io/wait requires
I'm running ruby 3.1 and
I upgraded from rails (7.0.2.4) to rails (7.0.4) |
Something is loading
Any changes re Ruby default gems in your Gemfile.lock when you upgraded? |
This is the gist of the upgrade: https://gist.github.com/silva96/f69a42f9ef3510e7761a8331a13edd3e |
Can you try a patch? Might be something particular with your setup. There are three files that have the conditional: unless Puma::HAS_NATIVE_IO_WAIT change that to: unless ::IO.public_instance_methods(false).include?(:wait_readable) |
Finally looked at Bundler code to see what was happening...
Nothing in the log you've shown indicates that. I suspect you need to add EDIT: Not sure what is going on, as I just checked locally. |
Yes is not in mine either, it never was. But I read somewhere that rails removed it from their dependencies in the latests versions. I came from this issue: #2843 |
I assume you're having the problem with restarts? Regardless, can you patch Puma, or work from a GitHub branch, etc? The Puma code that's logging what you listed is: puma/lib/puma/cluster/worker.rb Lines 61 to 66 in f323d12
So, the line EDIT: Given what's raising the error, maybe the following: rescue Exception => e
log "! Unable to start worker"
log "class: #{e.class}"
log " msg: #{e.message}"
if e.respond_to? :requirement
log "gem name: #{e.name}"
log " req: #{e.requirement}"
end
log e.backtrace.join("\n ")
exit 1
end |
Thanks I'll give it a try maybe on friday and let you know the output. |
Thanks. FYI, the above isn't fixing anything, but it's an attempt to get more info about what went wrong. As in #2843, it's difficult to repo locally, and since you've got the problem, the above patch should (hopefully) show enough info to identify the problem... |
Just if it helps, this is my puma.rb config in production: #!/usr/bin/env puma
directory '/home/ubuntu/www/current'
rackup "/home/ubuntu/www/current/config.ru"
environment 'production'
tag ''
pidfile "/home/ubuntu/www/shared/tmp/pids/puma.pid"
state_path "/home/ubuntu/www/shared/tmp/pids/puma.state"
stdout_redirect '/home/ubuntu/www/shared/log/puma_access.log', '/home/ubuntu/www/shared/log/puma_error.log', true
threads 0,16
bind 'unix:///home/ubuntu/www/shared/tmp/sockets/puma.sock'
workers 2
prune_bundler
on_restart do
puts 'Refreshing Gemfile'
ENV["BUNDLE_GEMFILE"] = ""
end |
Ok I found the problem, Context: I'm deploying using capistrano, and after deploy I restart puma using systemd In my puma.service
The thing is after deploying, asdf puma shim was not being updating from 5.x to 6 so the Gemfile version differed from the puma that was running. Using bundle exec would run the puma version recently installed. |
Description
In Ruby 3.1 and earlier versions, IO#wait_* methods were contained in the standard library gem
io/wait
. Ruby 3.2 has moved the methods to the main IO code. See 'Move wait* methods to io.c' ruby/ruby#6036.So,
io/wait
does not need to be required for Ruby 3.2 and later. Adjust code to only require it when needed.Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.