Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ruby packaging does not include gems #5567
This is a Bug Report
When I first deployed my Ruby lambda to AWS via serverless, it did not have any of the gems available.
This is out of scope for serverless framework. We don't even do this for NodeJS. Since ruby dependencies at least live in the same directory as your source code, you're lucky. I had to write serverless-python-requirements because of how python manages dependencies.
If you want to automatically install dependencies on deploy, I recommend writing a plugin to do so, or using the serverless hooks plugin.
first install the plugin:
Then add this to your
plugins: - serverless-hooks-plugin custom: hooks: package:initialize: - bundle install --deployment
well they don't typically live in the same directory.
but when you are packaging an app for deployment, you would run
thanks for the info on the python way and the hooks plugin. I'll look into those
This is not a problem for nodejs apps because npm builds the
I respectfully disagree that this is out of scope for serverless framework because the framework can even exclude development dependencies (still unclear for which runtimes, but Ruby isn't one of them): https://serverless.com/framework/docs/providers/aws/guide/packaging#development-dependencies
@dholdren I just published a blog post handling this problem: https://dev.to/jalerson/building-aws-lambdas-for-real-world-using-ruby-and-serverless-framework-2p49