Install Ruby
First you must install Ruby because Jekyll is a Ruby-based program and needs Ruby to run.
- Go to RubyInstaller for Windows.
- Under RubyInstallers, download and install one of the Ruby installers (usually one of the first two options).
- Double-click the downloaded file and proceed through the wizard to install it.
Install Ruby Development Kit
Some extensions Jekyll uses require you to natively build the code using the Ruby Development Kit.
- Go to RubyInstaller for Windows.
- Under the Development Kit section near the bottom, download one of the For use with Ruby 2.0 and above… options (either the 32-bit or 64-bit version).
- Move your downloaded file onto your C drive in a folder called something like RubyDevKit.
- Extract the compressed folder’s contents into the folder.
-
Browse to the RubyDevKit location on your C drive using your Command Line Prompt.
To see the contents of your current directory, type
dir
. To move into a directory, typecd foldername
, where “foldername” is the name of the folder you want to enter. To move up a directory, typecd ../
one or more times depending on how many levels you want to move up. To move into your user’s directory, type/users
. The/
at the beginning of the path automatically starts you at the root. - Type
ruby dk.rb init
- Type
ruby dk.rb install
If you get stuck, see the official instructions for installing Ruby Dev Kit.
Install Bundler
- Using the command line, browse to the folder where you downloaded the Jekyll theme.
-
Delete the existing Gemfile and Gemfile.lock files:
del Gemfile del Gemfile.lock
- Install Bundler:
gem install bundler
-
Initialize Bundler:
bundle init
This will create a new Gemfile.
-
Open the Gemfile in a text editor.
Typically you can open files from the Command Prompt by just typing the filename, but because Gemfile doesn’t have a file extension, no program will automatically open it. You may need to use your File Explorer and browse to the directory, and then open the Gemfile in a text editor such as Notepad.
-
Remove the existing contents. Then paste in the following:
source "https://rubygems.org" gem 'wdm' gem 'jekyll'
The wdm gem allows for the polling of the directory and rebuilding of the Jekyll site when you make changes. This gem is needed for Windows users, not Mac users.
- Save and close the file.
-
Type
bundle install
.Bundle retrieves all the needed gems and gem dependencies and downloads them to your computer. At this time, Bundle also takes a snapshot of all the gems used in your project and creates a Gemfile.lock file to store this information.
Serve the Jekyll site
- Browse to the jekyll theme directory.
- Type
jekyll serve
-
Go to the preview address in the browser. (Make sure you include the
/
at the end.)Unfortunately, the Command Prompt doesn’t allow you to easily copy and paste the URL, so you’ll have to type it manually.
Troubleshooting
Bundler retrieves the latest version of the jekyll gem that is compatible with the github-pages gem. Unfortunately, in my testing, I think that version of the jekyll gem has some issues with the kramdown gem. Later versions of the jekyll gem fix the kramdown compatibility issues. If you run into this issue, let me know (especially if you solved it).