Skip to content

Commit 729b858

Browse files
author
ilyasse benrkia
committed
docs: Add dependency management guidance
The managed runtime ships the AWS SDK and its transitive dependencies at specific versions. If a customer's Gemfile.lock pins a different version of an SDK transitive dependency (e.g. bigdecimal), they will encounter Gem::LoadError on function init. Closes #65
1 parent 7ae6e6c commit 729b858

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ You can include this package in your preferred base image to make that base imag
1212
## Requirements
1313
The Ruby Runtime Interface Client package currently supports ruby 3.0 and above.
1414

15+
## Dependency Management
16+
17+
When using Lambda's [managed Ruby runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html), the runtime includes the AWS SDK for Ruby and its transitive dependencies at specific versions. The SDK's dependencies are listed in the [`aws-sdk-core` gemspec](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-core/aws-sdk-core.gemspec) and include gems such as `bigdecimal`, `base64`, and `logger`.
18+
19+
If your `Gemfile.lock` pins a different version of one of these gems than what the runtime provides, you may encounter a `Gem::LoadError`:
20+
21+
```
22+
You have already activated bigdecimal X.Y.Z, but your Gemfile requires bigdecimal A.B.C.
23+
```
24+
25+
To avoid this:
26+
27+
- **Do not add version constraints** on transitive dependencies of the SDK in your Gemfile. Refer to the [`aws-sdk-core` gemspec](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-core/aws-sdk-core.gemspec) for the current list.
28+
- If you encounter a version conflict after a runtime update, **re-run `bundle install`** to update your lockfile to match the current runtime, then redeploy.
29+
- For full control over all dependencies, consider [bundling the SDK yourself](https://docs.aws.amazon.com/lambda/latest/dg/ruby-package.html#ruby-package-runtime-dependencies) or using a [container image](https://docs.aws.amazon.com/lambda/latest/dg/ruby-image.html).
30+
1531
## Migration from 2.x to 3.x
1632

1733
**Important**: Version 2.x is deprecated. Please upgrade to version 3.x. For more information about Lambda runtime support, see the [AWS Lambda runtimes documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).

0 commit comments

Comments
 (0)