在 Lambda 中运行 ruby 时'Could not find public_suffix-3.0.2 in any of the sources'



我有一个需要在 Lambda 上运行的 ruby 脚本,我创建了一个函数,所有文件都在一个文件夹中当我测试它时,出现错误:

"errorMessage": "Could not find public_suffix-3.0.2 in any of the sources"

我已经在 Gemfile.lock 中添加了这个库,所以我很困惑为什么会发生这种情况以及如何解决它?这就是我在Gemfile.lock中定义它的方式:

GEM
  remote: https://rubygems.org/
  specs:
    addressable (2.5.2)
      public_suffix (>= 2.0.2, < 4.0)
    .......

似乎您的public_suffix版本不匹配。

添加到您的宝石文件。

gem 'public_suffix', '~> 3.0', '>= 3.0.2'

运行bundle install

确保在您的Gemfile.lock中升级版本,并将文件夹添加到 Lambda。

最新更新