Created
September 14, 2025 03:23
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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