I use the combination of Jekyll and GitHub Pages for my blog and to make the publishing process smoother I wanted to have the same local testing experience on my Windows machine as I do on my Chromebook.
If you want to setup a Ruby environment capable of running Jekyll on a Windows 10 machine you can follow these steps.
Linux Subsystem for Windows
We will use the Linux Subsystem for Windows to run the testing environment.
Several different Linux distributions are available in the Microsoft Store, but these instructions assume the use of Ubuntu.
Open an administrator Powershell prompt and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Restart Windows.
- Open the Microsoft store app and install Ubuntu.
- The first time you run the Ubuntu app you will have to wait a little while for some additional installation steps to complete.
- Provide a username and password for the Ubuntu environment when prompted.
- You should now have a working Ubuntu shell.
Ensure that your package lists are up to date by running:
sudo apt-get update
Note that the first time you use
sudoin a session you will have to provide your password.
Install a few prerequisites to ensure that the subsequent steps go smoothly by running:
sudo apt-get install -y curl gnupg build-essential sudo apt-get install software-properties-common
RVM can be installed easily using
apt-get, but we need to reference the project’s personal package archive to do so:
sudo apt-add-repository -y ppa:rael-gc/rvm sudo apt-get update
sudo apt-get install rvm
You will need to add your user to the
rvmgroup before you can use rvm:
sudo usermod -a -G rvm <yourUserNameHere>
- Restart the Ubuntu app.
Install Ruby and Bundler:
rvm install ruby rvm use ruby gem install bundler
You now have everything you need to build and run a Jekyll site locally from the Ubuntu shell. If you have an existing site you can simply navigate to it (you will find your Windows drive at
/mnt/c) and run:
bundle install bundle exec jekyll serve
If you are starting from scratch you should be able to follow the instructions to create a new GitHub Pages site.
Leave a Comment
Your email address will not be published. Required fields are marked *