ruby-on-rails - 在 Elastic Beanstalk 上无法访问 Rails 服务器
问题描述
我在 EB 上部署了一个 Rails 应用程序,但This site can’t be reached
每次我尝试访问它的链接时它都会发出消息。我试图访问日志,但找不到任何有用的东西。但是,我尝试SSH
进入EB Instance
然后运行bundle exec rails c
并收到以下错误:
/var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': cannot load such file -- listen (LoadError)
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `block in require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/evented_file_update_checker.rb:6:in `<main>'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `block in require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require'
from /var/app/current/config/environments/development.rb:72:in `block in <main>'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/railtie.rb:234:in `instance_eval'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/railtie.rb:234:in `configure'
from /var/app/current/config/environments/development.rb:3:in `<main>'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `block in require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/engine.rb:571:in `block (2 levels) in <class:Engine>'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/engine.rb:570:in `each'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/engine.rb:570:in `block in <class:Engine>'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/initializable.rb:32:in `instance_exec'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/initializable.rb:32:in `run'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/initializable.rb:61:in `block in run_initializers'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/initializable.rb:50:in `each'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/initializable.rb:50:in `tsort_each_child'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:415:in `call'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:347:in `each'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:347:in `call'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
from /opt/rubies/ruby-2.6.8/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/initializable.rb:60:in `run_initializers'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/application.rb:391:in `initialize!'
from /var/app/current/config/environment.rb:5:in `<main>'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `block in require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/application.rb:367:in `require_environment!'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/command/actions.rb:28:in `require_environment!'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/commands/console/console_command.rb:101:in `perform'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/command/base.rb:69:in `perform'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/command.rb:48:in `invoke'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/railties-6.1.4.1/lib/rails/commands.rb:18:in `<main>'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /var/app/current/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from bin/rails:5:in `<main>'
我试图检查该错误,但无法理解其根本原因,我知道它与 bootsnap 有关,但不确定是什么。
环境细节:
- 导轨版本:
6.1.4
- 红宝石版本:
2.6.8
- Bootsnap 版本:
1.4.4
- EB平台分公司:
Ruby 2.6 running on 64bit Amazon Linux 2
- EB平台版本:
3.3.6
解决方案
推荐阅读
- node.js - 如何使用 dialogflow-nodejs-client-v2 将 Dialogflow API v2 与 MS BotFramework 集成
- json - kendo aspnetmvc 发布错误与 Jquery json 读取冲突
- pdf - 避免整个 html 表格以 pdf 格式在下一页上移动
- c# - 使用 busno 和 date 防止超订票
- java - 为什么 Apache Kafka 消费者不使用 Log4j2 根记录器?
- python - Python 中的硒。启动测试时,会弹出关于辅助类的消息
- mongodb - 带有前缀的 MongoDB 查询 $lookup
- android - Android Studio 3.1.4 设计预览不渲染材料设计元素
- javascript - 如何使用ajax防止数据表中的分页重置
- android - 使用 MockWebServer 运行测试总是调用失败回调(连接异常)