Windows WSL and GitHub Pages
The following information will help you get your Windows based PC set up to work with GitHub Pages using Ruby and Jekyll within the WSL (Windows Subsystem for Linux) environment. It will allow you to work with your files directly and run jekyll serve
to test locally.
This setup assumes you have installed WSL2 using Ubuntu (which includes Git by default) for your version of Linux.
Setup Git Global Variables
First and foremost, you’ll want to configure a couple of Git settings. These settings are how your Git commits and changes will be tied to you.
Set Your Name & Email
Install Ruby
Jekyll is built using Ruby and as such you will be using it to test and build your GitHub Pages website. You’ll start by installing a Ruby Environment Manager, in this case rbenv, which allows you to set and use a specific version of Ruby. Because GitHub Pages builds with Jekyll v3.9.0, the current max version of Ruby we can install is v2.7.5 which supported by said version of Jekyll.
Install Ruby Environment Manager
Add to PATH
Install renv Ruby Build
Run rbenv-doctor To Verify Install
You should see something like this if it was successful:
Install Ruby
Set Local Ruby Version
This will tell rbenv what version of Ruby to use for this project. At this point you should be able to run ruby -v
to check your Ruby install. It should return something along the lines of ruby 2.7.5
. If you see that, and the version matches the version you just installed, you’re good to go.
Install Bundler
Finally, you will want to install Bundler. This will allow you to safely run Ruby gems on your system without and elevated (sudo) prompt.