Jekyll is one of our favorite static site generators because it’s not only easy to learn and easy to build with, but it creates fast, modern websites that are almost impossible to hack and require little-to-no maintenance.
There are a few different ways to work with jekyll, you can install it locally on your computer (which is what this guide is going to show you how to do) or you can use a dev-container (helpful when you’re using someone else’s computer temporarily).
Step by step guide to installing Jekyll on Mac in 2024
Step 1: Get your Mac ready
First things first, make sure your Mac is ready to install Jekyll. You’ll need something called Xcode Command Line Tools. Don’t worry; it’s easy to get. Just follow these steps:
- Open Terminal. You can find it by searching in Spotlight or looking in your Applications folder.
- In Terminal, type the following and hit Enter:
xcode-select --install - You’ll probably see a pop-up asking if you want to install Command Line Tools. Click “Install” and follow the instructions.
Step 2: Install Homebrew
Homebrew is like a magic wand that helps you install software on your Mac without any hassle. Here’s how to get it:
- Still in Terminal, type this command and hit Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Follow the instructions you see on the screen. It’s like installing any other app.
Step 3: Install Ruby
Jekyll is built with Ruby, another cool tool. But before you install Jekyll, let’s make sure Ruby is set up properly:
- In Terminal, type
brew install rbenvand hit Enter. This will install rbenv, which helps manage different versions of Ruby. - After that’s done, type
eval "$(rbenv init -)"and hit Enter. This sets up rbenv to work its magic. - Now, let’s install Ruby itself. Type
rbenv install 3.0.1and hit Enter. This will install the latest version of Ruby. - Once it’s done, type
rbenv global 3.0.1and hit Enter. This makes sure your Mac knows to use Ruby 3.0.1. - To check if Ruby is installed correctly, type
ruby -vand hit Enter. You should see something like “ruby 3.0.1p64”.
Step 4: Install Jekyll
Now comes the fun part – installing Jekyll itself. In Terminal, type:
gem install jekyll bundlerand hit Enter. Gems are like little packages of code in Ruby, and Jekyll is just one of them.- Sit back and relax while your Mac does the heavy lifting.
Step 5: Start Your Jekyll Site
Now that everything’s set up, let’s create your first Jekyll site:
- In Terminal, navigate to the folder where you want to create your site. You can use the
cdcommand to move around. - Once you’re in the right folder, type
jekyll new myblogand hit Enter. This will create a new folder called “myblog” with all the files you need for your site. - Go into that folder using
cd myblog. - Finally, type
bundle exec jekyll serveand hit Enter. This will start a little server on your computer so you can see your site in action.
Troubleshooting Tips:
- If something goes wrong, don’t panic! Check if you followed each step carefully.
- If you see any error messages, try Googling them. Chances are, someone else has had the same issue before and found a solution.
- Feel free to ask for help on forums like Stack Overflow or in Jekyll’s official documentation.
- And if you’re one of Institute of Code’s web development students, remember you can reach out for help any time and receive one-on-one support from our experienced mentors.
By following these steps, you should now have Jekyll up and running on your Mac.
Installing Jekyll on a PC in 2024
Step 1: Install Ruby
Just like on a Mac, you’ll need Ruby installed on your PC. Here’s how:
- Head to the RubyInstaller website (https://rubyinstaller.org/) and download the latest version of Ruby for Windows.
- Run the downloaded installer and follow the installation instructions. Make sure to check the box that says “Add Ruby executables to your PATH.”
- Once installed, open Command Prompt (you can search for it in the Start menu) and type
ruby -vto verify that Ruby is installed correctly.
Step 2: Install Jekyll & build your site
Now that Ruby is set up, let’s install Jekyll:
- In Command Prompt, type
gem install jekyll bundlerand hit Enter. This command installs both Jekyll and Bundler, which helps manage Jekyll’s dependencies. - Wait for the installation to complete. Once done, you’re ready to start using Jekyll on your PC!
- In Terminal, navigate to the folder where you want to create your site. You can use the
cdcommand to move around. - Once you’re in the right folder, type
jekyll new myblogand hit Enter. This will create a new folder called “myblog” with all the files you need for your site. - Go into that folder using
cd myblog. - Finally, type
bundle exec jekyll serveand hit Enter. This will start a little server on your computer so you can see your site in action.
By following these steps, you should now have Jekyll up and running on your PC.