我在 docker 中调试应用程序时遇到问题。我认为我的设置是正确的,因为没有调试器一切都工作正常。
端口
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/usr/src/app
ports:
- "3000:3000"
- "1234:1234"
- "26162:26162"
- "26168:26168"
错误:(网站没有响应)
Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:1234
=> Booting Puma
=> Rails 5.2.3 application starting in development
=> Run `rails server -h` for more startup options
[8] Puma starting in cluster mode...
[8] * Version 4.0.1 (ruby 2.6.2-p47), codename: 4 Fast 4 Furious
[8] * Min threads: 5, max threads: 5
[8] * Environment: development
[8] * Process workers: 2
[8] * Preloading application
[8] * Listening on tcp://0.0.0.0:3000
[8] Use Ctrl-C to stop
[8] ! Terminating timed out worker: 16
[8] ! Terminating timed out worker: 18
[8] ! Terminating timed out worker: 20
[8] ! Terminating timed out worker: 21
[8] ! Terminating timed out worker: 24
[8] ! Terminating timed out worker: 25
[8] ! Terminating timed out worker: 28
[8] ! Terminating timed out worker: 29
最佳答案
我刚刚想通了。
我的解决方案将WEB_CONCURRENCY
设置为0(config/puma.rb
)
workers ENV.fetch("WEB_CONCURRENCY") { 0 }
对于生产系统,我更改了 .env
文件中的值。
WEB_CONCURRENCY=2
来源: * https://github.com/JetBrains/sample_rails_app/blob/master/config/puma.rb
# Note that workers are not supported for JRuby or Windows
#workers ENV.fetch("WEB_CONCURRENCY") { 2 }
关于RubyMine:终止超时工作线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59054977/