How to install jekyll on Apple M1 Macbook

Utpal Kumar   5 minute read      

In this post, we will see how we can install Jekyll on Apple’s M1 Macbook Pro, Air or Mac Mini. If you have recently bought a M1 mac and have been doing blogging using Jekyll, then you must have experienced that installing Jekyll on the M1 architecture is not so straightforward. We will see how we can install Jekyll for M1 Mac.

Before I share with you the commands I followed to install the Jekyll locally, I must share with you my OS. I am using MacBook Air (M1, 2020) with macOS BigSur (11.6).

Key idea — never build on the system Ruby. macOS ships its own Ruby at /usr/bin/ruby, but it’s old, locked down, and needs sudo for gems — the root cause of most “Jekyll won’t install” pain. The fix is a clean layered stack: install a version manager (rbenv), use it to install a modern Ruby you fully own, then install jekyll as a user gem. Get that stack right and the Apple-Silicon architecture stops mattering.

The Jekyll install stack on Apple Silicon Each layer builds on the previous: Xcode command-line tools, then Homebrew, then rbenv with ruby-build, then a modern Ruby with gems, then jekyll serve. Xcode CLT compilers + libs Homebrew /opt/homebrew rbenv + ruby-build Ruby version manager Ruby 3.x + gems bundler, jekyll jekyll serve local site
The install is a stack: each layer depends on the one before it, ending in a local Jekyll server.

If you’re reading this on a newer Mac (M2/M3/M4), the hard part is mostly gone. Back in 2021, native arm64 builds of Ruby and many gems didn’t exist yet, so people resorted to Rosetta and arch -x86_64 hacks. As of 2026, Homebrew and the popular gems all ship native Apple-Silicon builds — no Rosetta workaround is needed. Two things have changed in the steps below: (1) on Apple Silicon, Homebrew installs to /opt/homebrew (not /usr/local), and (2) Ruby 3.0.0 is now end-of-life — install a currently supported release instead (Ruby 3.4.x is the recommended version for Jekyll today). Everywhere you see 3.0.0 below, substitute the version you install.

Requires Xcode installation

If you have recently purchased your Macbook, then you may not have installed Xcode yet. Xcode comes with a set of libraries required by other programs including for our installation of Jekyll.

xcode-select --install

Requires Homebrew

I use Homebrew to install third party packages on my Mac. It can be installed by simply:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Rbenv

We need to install a Ruby version that is compatible with ARM processor.

brew install rbenv ruby-build

Install ARM based Ruby 3.0.0

rbenv install 3.0.0
rbenv global 3.0.0
ruby -v
rbenv rehash

Use a supported Ruby. rbenv install 3.0.0 still works, but 3.0 no longer gets security fixes. Run rbenv install -l to list the latest stable releases and install a current one, e.g. rbenv install 3.4.9 && rbenv global 3.4.9. Everything downstream (the PATH line, webrick) then uses that number instead of 3.0.0.

Add the ruby and gems path to your shell configuration

Now, add rbenv to bash so that it loads every time you open a terminal

if you are using zsh

echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc

if you are using bash

echo 'eval "$(rbenv init - bash)"' >> ~/.bash_profile

If you are not sure which shell you are using, you can check that using the command:

echo $SHELL

Install Jekyll

Finally, we can proceed to install Jekyll and Bundler. We will be doing the local install (it does not require sudo privileges).

gem install --user-install bundler jekyll

if you are using zsh

Replace 3.0.0 with your ruby version. You can check your ruby version by ruby -v. If your ruby version is 2.7, then use 2.7.0.

echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.zshrc

if you are using bash

Replace 3.0.0 with your ruby version. You can check your ruby version by ruby -v. If your ruby version is 2.7, then use 2.7.0.

echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.bash_profile

A note on that PATH line. Since we set Ruby up through rbenv, the eval "$(rbenv init -)" you added above already puts the active Ruby (and its gems’ bin) on your PATH via rbenv’s shims — so this manual export PATH=... is usually redundant. It also points at /usr/local/..., which is the Intel/Homebrew location; on Apple Silicon a brew-installed Ruby lives under /opt/homebrew/opt/ruby/bin. If a freshly installed jekyll/bundle command isn’t found, run rbenv rehash and open a new terminal before editing PATH by hand.

More updates

For M1 Mac, we may need to do a few extra steps - update bundler, add webrick, and rebuild everything.

bundle update --bundler
bundle add webrick
bundle install --redownload

Quick check: Why does bundle add webrick show up in a modern Jekyll setup?

  • Webrick is Apple-Silicon-specific
  • Ruby 3.0+ removed webrick from the standard library, so Jekyll’s local server needs it added explicitly (unless you’re on Jekyll ≥ 4.3, which handles it)
  • It replaces rbenv
  • Jekyll can’t build pages without it

Check installation

Now, we can run our example blog. Navigate to your blog and then run the following commands:

  • If you have not done local install
    gem install bundler jekyll 
    
  • If you don’t have a blog, then create one using
    jekyll new my-awesome-site
    cd my-awesome-site
    

You can run the blog locally using the command:

bundle exec jekyll serve

Hope it works in your case! Enjoy your M1 Mac!!

Recap

  • Don’t use system Ruby. /usr/bin/ruby is the trap; install your own Ruby with rbenv so gems install without sudo.
  • Build the stack in order: Xcode CLT → Homebrew (/opt/homebrew on Apple Silicon) → rbenv + ruby-build → a modern Ruby → user-installed bundler/jekyllbundle exec jekyll serve.
  • Pick a current Ruby. 3.0.0 is EOL — install a supported release (Ruby 3.4.x is recommended for Jekyll now) and substitute that version wherever you see 3.0.0.
  • webrick is the one modern gotcha. Ruby 3.0+ dropped it from the stdlib, so bundle add webrick (or Jekyll ≥ 4.3) keeps jekyll serve working.
  • The M1 hack era is over. Native arm64 gems mean no Rosetta / arch -x86_64 juggling on today’s Macs.

Where to go next

Disclaimer of liability

The information provided by the Earth Inversion is made available for educational purposes only.

Whilst we endeavor to keep the information up-to-date and correct. Earth Inversion makes no representations or warranties of any kind, express or implied about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services or related graphics content on the website for any purpose.

UNDER NO CIRCUMSTANCE SHALL WE HAVE ANY LIABILITY TO YOU FOR ANY LOSS OR DAMAGE OF ANY KIND INCURRED AS A RESULT OF THE USE OF THE SITE OR RELIANCE ON ANY INFORMATION PROVIDED ON THE SITE. ANY RELIANCE YOU PLACED ON SUCH MATERIAL IS THEREFORE STRICTLY AT YOUR OWN RISK.


Leave a comment