尝试使用Elastic Beanstalk部署Sinatra应用
我得到(日志)
...
+ cat Gemfile
source 'https://rubygems.org'
gem 'sinatra'
gem 'aws-sdk-s3'
+ '[' -d /var/app/ondeck/vendor/cache ']'
+ bundle install
/opt/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:284:in `find_spec_for_exe': Could not find 'bundler' (2.0.2) 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.0.2`
from /opt/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
from /opt/rubies/ruby-2.6.5/bin/bundle:23:in `<main>' (Executor::NonZeroExitStatus)
我尝试更改config.ru
并添加
require './app.rb'
gem install bundler:2.0.2 # <-- added this
bundle update --bundler # <-- added this
bundle # <-- added this
run Sinatra::Application
但这没有帮助-似乎没有改变行为。
config.ru
甚至是正确的文件也要更改吗?无论有没有我的bundle命令,它似乎都会尝试捆绑。
我尝试从捆绑包中删除我的Gemfile.lock文件,并且可以正常工作。
但是,我想知道如何每次都避免这种情况,而又不将本地系统还原为旧的捆绑程序1。换句话说,当尝试失败时,如何使beantalk使用捆绑程序2。