-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find *gem* in any of the sources w/t require "bundler/setup" #36
Comments
Can you share yours |
@navarasu I'm using the docker version, running via CircleCI. provider:
name: aws
runtime: ruby2.5
plugins:
- serverless-ruby-layer
package:
include:
- Gemfile
- Gemfile.lock
- handler.rb
- config/**
- app/**
- ./
custom:
rubyLayer:
use_docker: true
|
Thanks. Is your aws runtime version 2.5? or 2.7? provider:
name: aws
runtime: ruby2.5 |
Whoops, I forgot that part, It's provider:
name: aws
runtime: ruby2.5 |
@Mongey I am not sure that issue #40 is related to your issue. Currently, I have created an example for your case and tried to reproduce the issue in my local with the 1.4.0 version. With the existing serverless version (1.4.0) itself, I have tried the require 'rubygems'
require 'bundler/setup'
Bundler.require(:default) It is working without any issue Below is the example I have tried. The folder contains the following four files, ➜ basic-requires-all tree
.
├── Gemfile
├── Gemfile.lock
├── handler.rb
└── serverless.yml
0 directories, 4 files Gemfile source 'https://rubygems.org'
gem 'httparty'
gem 'nokogiri' Gemfile.lock GEM
remote: https://rubygems.org/
specs:
httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0225)
mini_portile2 (2.5.1)
multi_xml (0.6.0)
nokogiri (1.11.3)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
racc (1.5.2)
PLATFORMS
ruby
DEPENDENCIES
httparty
nokogiri
BUNDLED WITH
2.1.4 handler.rb require 'rubygems'
require 'bundler/setup'
Bundler.require(:default)
def hello(event:, context:)
body = HTTParty.get("https://github.com").body
doc = Nokogiri::HTML(body)
{ statusCode: 200, body: doc.title }
end serverless.yml service: basic
plugins:
- serverless-ruby-layer
provider:
name: aws
runtime: ruby2.5
custom:
rubyLayer:
use_docker: true
package:
include:
- Gemfile
- Gemfile.lock
functions:
hello:
handler: handler.hello I am not able to reproduce your issue. As @jagthedrummer said, the mismatch between So please share the appropriate |
Hi @Mongey, I am able to reproduce the issue by replacing it with a different version for a dependency gem in Gemfile.lock
In Gemfile.lock, the mime-types-data gem version is
|
…nd Gemfile.lock in package if lock file is present
So the below config not required package:
include:
- Gemfile
- Gemfile.lock It will auto-include
|
Fix #40 solves this ticket. I will update the doc and will create a new release |
#36 Added example and test for bundler.require all. Include Gemfile and Gemfile.lock in package if lock file is present
@Mongey This fix is included in release 1.5.0. Please update the npm version and verify.
|
Describe the bug
To auto require gems, we specific the following.
I can remove these requires, and it works, but, wondering why it doesn't
Error Stack Trace
The text was updated successfully, but these errors were encountered: