I\'m writing a Lambda function in Ruby which will eventually send me some notifications in Slack via Webhook. So what I have for my lambda_function
file is
I think you should not change the GEM_PATH or having to set $LOAD_PATH
in every lambda functions.
The "best" way is to do this little hack when you create the layer archive:
bundle install --path vendor/bundle
cd vendor/bundle
mkdir ruby/gems
mv ruby/2.5.0 ruby/gems/
zip -r layer.zip ruby/gems/2.5.0/