我试着在AWS弹性Beanstalk上运行我的rails 5站点,除了Puma一直关闭之外,一切似乎都在工作。
日志如下。我试过用谷歌搜索错误,但只是得到了不同问题的无关解决方案。我想我的puma配置文件有问题,但是我不知道我需要更改什么。现在我只有标准了
puma.rb
文件。
-------------------------------------
/var/log/nginx/error.log
-------------------------------------
2018/08/08 19:19:31 [warn] 3023
2018/08/08 19:20:34 [crit] 3027
2018/08/08 21:12:16 [warn] 2967
2018/08/08 22:02:02 [warn] 5848
2018/08/08 22:02:02 [warn] 5858
-------------------------------------
/var/log/puma/puma.log
-------------------------------------
=== puma startup: 2018-08-08 19:21:42 +0000 ===
=== puma startup: 2018-08-08 19:21:42 +0000 ===
[17439] - Worker 0 (pid: 17442) booted, phase: 0
[17439] - Gracefully shutting down workers...
=== puma startup: 2018-08-08 21:12:05 +0000 ===
=== puma startup: 2018-08-08 21:12:05 +0000 ===
[2406] - Worker 0 (pid: 2459) booted, phase: 0
[2406] - Gracefully shutting down workers...
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in `getwd': No such file or directory - getcwd (Errno::ENOENT)
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in `pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in `block in pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:70:in `pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:43:in `block in report'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:42:in `each'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:42:in `report'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:96:in `request_issue_report_for'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:46:in `log_error'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:126:in `rescue in with_friendly_errors'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/exe/bundle:22:in `<top (required)>'
from /opt/rubies/ruby-2.5.1/bin/bundle:23:in `load'
from /opt/rubies/ruby-2.5.1/bin/bundle:23:in `<main>'
=== puma startup: 2018-08-08 21:12:55 +0000 ===
=== puma startup: 2018-08-08 21:12:55 +0000 ===
[3420] - Worker 0 (pid: 3423) booted, phase: 0
[3420] - Gracefully shutting down workers...
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in `getwd': No such file or directory - getcwd (Errno::ENOENT)
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in `pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:71:in `block in pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:70:in `pwd'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:43:in `block in report'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:42:in `each'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/env.rb:42:in `report'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:96:in `request_issue_report_for'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:46:in `log_error'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:126:in `rescue in with_friendly_errors'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
from /opt/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.0/exe/bundle:22:in `<top (required)>'
from /opt/rubies/ruby-2.5.1/bin/bundle:23:in `load'
from /opt/rubies/ruby-2.5.1/bin/bundle:23:in `<main>'
=== puma startup: 2018-08-08 21:56:20 +0000 ===
=== puma startup: 2018-08-08 21:56:20 +0000 ===
[5379] - Worker 0 (pid: 5382) booted, phase: 0
[5379] - Gracefully shutting down workers...
=== puma startup: 2018-08-08 21:58:45 +0000 ===
=== puma startup: 2018-08-08 21:58:45 +0000 ===
[5532] - Worker 0 (pid: 5535) booted, phase: 0
[5532] - Gracefully shutting down workers...
=== puma startup: 2018-08-09 00:36:36 +0000 ===
=== puma startup: 2018-08-09 00:36:36 +0000 ===
[11544] - Worker 0 (pid: 11547) booted, phase: 0
[11544] - Gracefully shutting down workers...
=== puma startup: 2018-08-09 00:38:14 +0000 ===
=== puma startup: 2018-08-09 00:38:14 +0000 ===
[11706] - Worker 0 (pid: 11709) booted, phase: 0
[11706] - Gracefully shutting down workers...
=== puma startup: 2018-08-09 00:43:55 +0000 ===
=== puma startup: 2018-08-09 00:43:55 +0000 ===
[12305] - Worker 0 (pid: 12308) booted, phase: 0
[12305] - Gracefully shutting down workers...
=== puma startup: 2018-08-09 00:47:12 +0000 ===
=== puma startup: 2018-08-09 00:47:12 +0000 ===
[12506] - Worker 0 (pid: 12509) booted, phase: 0
编辑:我的彪马配置文件
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
port ENV.fetch("PORT") { 3000 }
environment ENV.fetch("RAILS_ENV") { "development" }
bind "unix:///var/run/puma/my_app.sock"
pidfile "/var/run/puma/my_app.sock"
plugin :tmp_restart