If your following the MacOS instructions and running on Apple M1 with Sequoia 15.5, I've got it to work using the following command:
sudo gem install -n /usr/local/bin jekyll
https://jekyllrb.com/docs/troubleshooting/#macos