AWS Amplify Incompatible with Current Version of Ruby
[INFO]: Resolving dependencies... [INFO]: [WARNING]: jekyll-feed-0.16.0 requires ruby version >= 2.5.0, which is incompatible with the current version, ruby 2.4.6p354 [ERROR]: !!! Build failed [ERROR]: !!! Non-Zero Exit Code detected
By default, AWS Amplify runs builds on Amazon Linux 2 machines. This has the default Ruby version set to 2.4.6, as you can see in the output. My initial Google results pointed towards needing to make a custom Docker image with a later version of Ruby installed. Yikes, that’s a lot of work.
Fortunately, there’s an easier way: specify the ruby version in your
+ ruby '3.0.0' source "https://rubygems.org" gem "jekyll", "~> 4.2.0"
Looks like to get past the error, I just needed ruby 2.5.0, but my dev environment used ruby 3.0.0. So I went big.
That’s it! Amplify picked up the specific ruby version and built the new dependencies without issue.