Skip to content

Instantly share code, notes, and snippets.

@kenjij
Created September 14, 2025 03:23
Show Gist options
  • Select an option

  • Save kenjij/5f873cedc78514c2062f056d411475c9 to your computer and use it in GitHub Desktop.

Select an option

Save kenjij/5f873cedc78514c2062f056d411475c9 to your computer and use it in GitHub Desktop.
Create a gem package for AWS Lambda Layers to use bigdecimal with Ruby 3.4
#
# Set up an instance with Amazon Linux 2023 (identical to Lambda Ruby 3.4 environment)
# Install Ruby 3.4.0 (or via RVM)
# Make sure to rename the native extention directory name to match version string
#
all: build package
build:
gem i bigdecimal -Ni ruby/gems/3.4.0
@if [ -d "ruby/gems/3.4.0/extensions/aarch64-linux/3.4.0+1" ]; then \
mv "ruby/gems/3.4.0/extensions/aarch64-linux/3.4.0+1" "ruby/gems/3.4.0/extensions/aarch64-linux/3.4.0"; \
fi
ls -m ruby/gems/3.4.0/gems
package:
zip -r lambda-layers . -x ".*" -x "*/.*" -x "Makefile"
zipinfo -t lambda-layers
clean:
rm -Rfv "ruby"
cleanall: clean
rm -fv lambda-layers.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment