Troubleshooting deployment of Jekyll static sites with AWS Amplify

This very site is made with Jekyll and deployed with AWS Amplify. Prior to Amplify, hosting static sites on AWS required you to manually configure S3 buckets, CloudFront origins and Route 53 hosted zones. Properly routing all traffic through HTTPS was cumbersome and you still you to roll out your own deployment pipeline!

AWS Amplify Console is a much more convenient and effective way of hosting static sites on AWS. Amplify provides continuous deployment and hosting for web apps (single page apps or static site generators).

Continuous deployment allows you to deploy updates to your site on every code commit to a Git repository. Hosting includes features such as globally available CDNs, 1-click custom domain setup + HTTPS, feature branch deployments, redirects, trailing slashes, and password protection.

These step-by-step guides are useful:

Troubleshooting

As of February 2019, if you are using bundler version 2.0 or higher, the Jekyll template provided by AWS Amplify will fail during the build stage:

# Starting phase: preBuild
# Executing command: bundle install
2019-02-08T17:57:17.955Z [WARNING]: /usr/local/rvm/rubies/ruby-2.3.6/lib/ruby/site_ruby/2.3.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
	from /usr/local/rvm/rubies/ruby-2.3.6/lib/ruby/site_ruby/2.3.0/rubygems.rb:308:in `activate_bin_path'
	from /usr/local/rvm/gems/ruby-2.3.6/bin/bundle:23:in `<main>'
	from /usr/local/rvm/gems/ruby-2.3.6/bin/ruby_executable_hooks:24:in `eval'
	from /usr/local/rvm/gems/ruby-2.3.6/bin/ruby_executable_hooks:24:in `<main>'
2019-02-08T17:57:17.959Z [ERROR]: !!! Build failed
2019-02-08T17:57:17.959Z [ERROR]: !!! Non-Zero Exit Code detected
2019-02-08T17:57:17.959Z [INFO]: # Starting Environment Caching...
2019-02-08T17:57:17.959Z [INFO]: # Environment Caching completed
Terminating logging...

If you generated your site with bundler 2.0+, try downgrading bundler to 1.7.3:

gem install -v 1.17.3

Then edit the end of your Gemfile.lock so it says “BUNDLED WITH 1.17.3” instead of “BUNDLED WITH 2.X.X”:

BUNDLED WITH
   1.17.3

The next build in AWS Amplify should succeed.

Where did your disk space go?

Find out with Drive Declutter for Windows



Version 1.1 (3 MB download)