首页 > 解决方案 > AWS ElasticBeanstalk + Ruby on Rails:Bundler `shared_helpers` 错误

问题描述

我正在尝试更新我的 Rails 应用程序的 Ruby 版本,并且在部署到 AWS ElasticBeanstalk 时遇到了 Bundler 问题。

将 Ruby 从版本升级2.3.42.5.7

我的 ElasticBeanstalk 环境正在运行 Ruby-2.5.7,我能够成功部署应用程序。

在我的日志中,我在尝试加载网站时遇到错误。

=== puma startup: 2019-10-22 20:41:56 +0000 ===
=== puma startup: 2019-10-22 20:41:56 +0000 ===
[22501] - Worker 0 (pid: 22504) booted, phase: 0
[22501] - 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.7/lib/ruby/site_ruby/2.5.0/bundler/shared_helpers.rb:71:in `getwd': No such file or directory - getcwd (Errno::ENOENT)
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/shared_helpers.rb:71:in `pwd'
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/shared_helpers.rb:71:in `block in pwd'
    from /opt/rubies/ruby-2.5.7/lib/ruby/2.5.0/monitor.rb:235:in `mon_synchronize'
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/shared_helpers.rb:70:in `pwd'
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/shared_helpers.rb:272:in `search_up'
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/shared_helpers.rb:155:in `print_major_deprecations!'
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:23:in `ensure in start'
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:23:in `start'
    from /opt/rubies/ruby-2.5.7/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
    from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
    from /opt/rubies/ruby-2.5.7/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
    from /opt/rubies/ruby-2.5.7/bin/bundle:23:in `load'
    from /opt/rubies/ruby-2.5.7/bin/bundle:23:in `<main>'

如何使用我的 ElasticBeanstalk 环境解决此问题?

标签: ruby-on-railsrubybundleramazon-elastic-beanstalk

解决方案


推荐阅读