Open jaredSiebert opened 4 months ago
Quick and dirty fix that I did
Starting at line 130
docker(['exec','-w',this.docker_gem_path, docker_id].concat(bundle_args),options,this.cli)
this.aws_gem_path = this.docker_gem_path+'/build/ruby/gems'
docker(['exec', docker_id, 'mkdir', this.aws_gem_path], options, this.cli)
docker(['exec', docker_id, 'mv', this.docker_gem_path+'/build/ruby/3.2.0', this.aws_gem_path], options, this.cli)
docker(['cp', '-L', container_id+':'+this.docker_gem_path+'/build/ruby', this.build_path], options, this.cli)
Just following up on this - would be nice to not have to monkey patch each of my projects
AWS Lambda with Ruby 3.2 error - by setting the GEM_PATH environment variable, the native aws-sdk gems cannot load
Additional context As outlined in AWS docs for including gems from layers (https://docs.aws.amazon.com/lambda/latest/dg/ruby-package.html#ruby-package-dependencies-layers), if the generated zip file structure changes from
ruby/3.2.0/*
toruby/gems/3.2.0/*
then there is no need to set the GEM_PATH environment variable which will eliminate the issue of the native aws-sdk gems not being found.Confirmed this works by compiling the
deploy_http_nokogiri
sample (https://navarasu.github.io/serverless-ruby-layer/#/use_docker), unzipping gemLayer.zip and adjusting the folder structure, zipping and manually uploading a custom layer to AWS.