Video: Install Jekyll on Apple Silicon
Think of Homebrew as an app store for the command line. Everything you install for Jekyll will be free and open source.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Note: be sure to replace [username]
with the username you use on your Mac.
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[yourusername]/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
export SDKROOT=$(xcrun --show-sdk-path)
You can see the version of Ruby pre-installed with your Mac, by typing:
ruby -v
brew install ruby@3.0
Type:
echo $SHELL
The result will be zsh
or bash
For zsh, type:
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
For bash, type:
echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.bash_profile
Type:
exit
Quit terminal
Run terminal again and type:
ruby -v
(make sure it is ruby 3.0.x)
Type:
gem install --user-install bundler jekyll
Type:
echo $SHELL
For zsh, type:
echo 'export PATH="$HOME/.gem/ruby/3.0.0/bin:$PATH"' >> ~/.zshrc
For bash, type:
echo 'export PATH="$HOME/.gem/ruby/3.0.0/bin:$PATH"' >> ~/.bash_profile
Type:
gem env
Look for the "GEM PATHS" section and make sure they all refer to 3.0.0
Type:
cd desktop
mkdir jekylltest
cd jekylltest
Create a .gitignore
file at the rooy of your jekylltest
folder
Add the following lines to the file:
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata
.bundle/
vendor/
# optional for macs:
**/.DS_Store
You will create a Jekyll site based on the default Minima theme that ships with Jekyll. If you want to choose a different type of site (different theme, blank site, etc), follow this link: https://jekyllrb.com/docs/usage
Type:
bundle init
bundle add jekyll --version "~>4.2"
bundle config set --local path 'vendor/bundle'
bundle install
bundle exec jekyll new --force --skip-bundle .
bundle add webrick
bundle install
bundle update
bundle exec jekyll serve --livereload
Copy the resulting URL (it usually ends in 4000
)
Paste the text into a browser
The site should run!