无法成功部署到 Beanstalk
Posted
技术标签:
【中文标题】无法成功部署到 Beanstalk【英文标题】:Can't make successful deploy to Beanstalk 【发布时间】:2020-05-10 05:39:18 【问题描述】:我正在使用 eb CLI 将我的 RoR API 部署到 Beanstalk,虽然部署工作正常,但应用程序降级。我可以看到它失败了:
+ bundle install
/opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/rubygems.rb:284:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /var/app/ondeck/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/rubygems.rb:303:in `activate_bin_path'
from /opt/rubies/ruby-2.5.7/bin/bundle:23:in `<main>'.
我没有在 AWS 文档中找到我应该做些什么来解决这个问题并防止再次发生。有没有人有同样的经历,或者知道为什么会这样,更重要的是,如何解决它。
【问题讨论】:
【参考方案1】:您的弹性 beanstalk 的捆绑器版本不是您的项目所需的 2.1.4。添加 elastic beanstalk 配置文件以升级预安装的 elastic beanstalk 捆绑器。
#.ebextensions/bundler_update.config
commands:
update_bundler:
command: /opt/rubies/ruby-2.5.7/bin/gem install bundler -v 2.1.4
Ruby 和 Bundler 版本应该与您的匹配。
【讨论】:
以上是关于无法成功部署到 Beanstalk的主要内容,如果未能解决你的问题,请参考以下文章
在虚拟机环境(CentOS7系统)下将kubernetes中部署服务成功,但在虚拟机外部无法访问到服务
部署到 Heroku 时 Django 应用程序崩溃 - Worker 无法启动