sinatra应用程序的aws beantalk-无法找到您的/var/app/ondeck/Gemfile.lock所需的“ bundler”(2.0.2)

时间:2019-12-25 01:49:34

标签: amazon-elastic-beanstalk bundle bundler gemfile gemfile.lock

总结:当我的尝试失败时,如何让beantalk使用bundler 2

尝试使用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。

0 个答案:

没有答案