How to fix "s3_website" issue while pushing Jekyll site on CloudFront through gitlab CI/CD?

We ran into this same error on CircleCI. If I understand correctly, the s3_website gem wraps a Java .jar that's using JRuby 1.7, and something must have changed in one of the Docker images or Ruby gems that causes it to start inheriting the system's Ruby 2+ path. As a result, its JRuby 1.7 tries to load Ruby gems that only work in Ruby 2.0 and above, so it runs into errors.

As a workaround, instead of letting the s3_website gem invoke the .jar file itself, I tell the s3_website gem to only download the .jar file, then I manually invoke it:

bundle exec s3_website install
java -cp $(bundle show s3_website)/*.jar s3.website.Push

I reported this on the s3_website project's GitHub page.