I could not get the official Jekyll documentation to work on my Mac, but I found a solution through this video, from this comment thread.

brew install ruby@3.3

Next, set this ruby as your default Ruby in your .zshrc file.

export PATH="/opt/homebrew/opt/ruby@3.3/bin:$PATH"

And then I ran:

gem install bundle jekyll webrick

Now update your PATH again for your gems.

export PATH="$HOME/.gem/ruby/3.3.0/bin:$PATH"

In the documentation about creating a Jekyll site on GitHub Pages, step 7 should be:

jekyll new --skip-bundle --force .

To run this locally, use the following.

bundle exec jekyll serve --livereload