You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sam package correctly includes vendored RubyGems if the --template-file argument is omitted and the default (template.yaml) is used. However, if you specify --template-file template.yaml explicitly, a package is generated and uploaded, but it does not include vendored gems, leading to runtime failures when gems are missing or do not match the version locked in Gemfile.lock.
Steps to reproduce:
sam init --app-template hello-world --runtime ruby3.3 --no-tracing --no-application-insights --no-structured-logging --package-type Zip
sam build && sam package --template-file template.yaml logs.txt
Observed result:
If you run aws s3 cp s3://aws-sam-cli-managed-default-samclisourcebucket-t3venr6as008/530d0f91bb545a27febc4651f7d0e701 packaged.zip to download the package and unzip -l packaged.zip you can see that only the source files are present:
Archive: packaged.zip
Length Date Time Name
--------- ---------- ----- ----
1126 1980-01-01 00:00 app.rb
61 1980-01-01 00:00 Gemfile
--------- -------
1187 2 files
Expected result:
If you omit --template-file template.yaml, everything works as expected and the uploaded Zip package contains the vendored gems:
I don't see anything in the --help for sam package that would indicate why explicitly specifying the template file would cause such a dramatic difference in behavior. Am I missing something? Thank you!
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Description:
sam package
correctly includes vendored RubyGems if the--template-file
argument is omitted and the default (template.yaml) is used. However, if you specify--template-file template.yaml
explicitly, a package is generated and uploaded, but it does not include vendored gems, leading to runtime failures when gems are missing or do not match the version locked in Gemfile.lock.Steps to reproduce:
sam init --app-template hello-world --runtime ruby3.3 --no-tracing --no-application-insights --no-structured-logging --package-type Zip
sam build && sam package --template-file template.yaml
logs.txt
Observed result:
If you run
aws s3 cp s3://aws-sam-cli-managed-default-samclisourcebucket-t3venr6as008/530d0f91bb545a27febc4651f7d0e701 packaged.zip
to download the package andunzip -l packaged.zip
you can see that only the source files are present:Expected result:
If you omit
--template-file template.yaml
, everything works as expected and the uploaded Zip package contains the vendored gems:I don't see anything in the
--help
forsam package
that would indicate why explicitly specifying the template file would cause such a dramatic difference in behavior. Am I missing something? Thank you!Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.129.0Paste the output of
sam --info
hereThe text was updated successfully, but these errors were encountered: