Due to new security features in macOS Mojave and later, the tutorial on Jekyll website will raise an error when running command: gem install <PACKAGE>:

ERROR:  Loading command: install (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

The solution is to reinstall ruby with openssl, as discussed in this thread:

  • Step 1: install openssl: brew install rbenv/tap/openssl@1.0
  • Step 2: install/reinstall ruby with openssl: rvm install <RUBY_VERSION> --with-openssl-dir='/usr/local/opt/openssl@1.0' (if reinstall, replace install with reinstall)
  • Step 3: update gem: gem update --system

You are good to go! Have fun with gem!