Today’s goal, get Jekyll working locally on my M1 Mac. To make this extra interesting, I am going to restrict myslef to Ruby 2.7 because, as of this writing that’s what Lambda supports.
I ran into quite a few errors:
http-parser wouldn’t compile vexed me for the longest time. There were problems with
libffi, as well. I came to the realization that my Home and RBEnv configurations were a combination of
arm64. I also had Homebrew and RBEnv entries scattered across
~/.zshrc. This is a case where a clean install of it all was the best course of action.
I came across a very helpful blog post from February. In it, Alex Manrique describes how to install everything to leverage Rosetta, Apple’s x86_64 emulation layer. While this is clever, I really wanted to get things working with native M1 code. Luckily brew has been hard at work getting things working for the M1.
This is how I got everything working.
- Uninstalled Home from
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Home/install/HEAD/uninstall.sh)"
- Deleted everything else under
/usr/local, aside from BBEdit tools in
~/.zshrc. Don’t worry, these files only had references to Home and RBEnv.
- Re-installed Home using the default method.
- Built a new
.zprofile, and reloaded it (
source ~/.zprofile): export SDKROOT=$(xcrun –show-sdk-path) eval “$(/opt/home/bin/ shellenv)” eval “$(rbenv init -)”
- Installed rbenv from ` install rbenv
. The documentation is ambiguous to how to add rbenv to the permanent environment; thus the.zprofile` above.
- Installed Ruby 2.7.4:
rbenv install 2.7.4; rbenv global 2.7.4. I’ll use a more specific version in my actual blog, but we need something to get going.
- Lets make sure we are using rbenv:
which rubyshould be
which gemshould be
gem update && rbenv rehash
gem install bundler && rbenv rehash: the Jekyll docs say to use
--user-install, but that installs it outside of
rbenv; not what we want.
gem install jekyll && rbenv rehash
Much better, no errors!
Now, to breath life back into the blog.
- I checked out the blog from my GitHub repo. This already has a Jekyll setup, as I’ve been hosting it on GitHub Pages for a few years.
- I created a scratch blog, to see what the latest Gemfile looked like, and updated the “real” Gemfile a bit; mostly providing specific version numbers for
- from the repo, I ran the standard jekyll commands:
bundle install && bundle exec jekyll serve.
And there we go, a local install of Jekyll. I know, this shouldn’t seem like a big deal, and it wasn’t, really. I just had to cleanup my local tools.
Next up, I’ll start working on a CloudFormation template.