Setting up Jekyll on Windows
This is how I installed Jekyll on Windows 10 using two approaches:
Background:
- Jekyll requires Ruby to run
- GitHub Pages can host Jekyll sites
- This blog is hosted on GitHub Pages
The official instructions are found here: https://jekyllrb.com/docs/windows/
Chocolatey
This approach runs Jekyll directly on your Windows operating system.
Open a command prompt as Administrator.
Install Chocolatey:
Ruby
Install Ruby:
Jekyll
Open a new command prompt, so that changes to the PATH
environment variable becomes effective.
Install Jekyll:
Install Gems:
Build and serve the site:
Docker
This approach runs Jekyll in a Linux container with Docker using the image: https://github.com/Starefossen/docker-github-pages
Download and install: Docker for Windows
Share your local drives (volumes) with Docker for Windows, so that they are available to your Linux containers: Shared drives
Open a command prompt.
Build and serve the site with docker run
:
Or build and serve the site with docker-compose
:
using this docker-compose.yml
file:
Troubleshooting
Get errors when switching between the Chocolatey and Docker approach? Try to delete the Gemfile.lock
file!
Get errors like driver failed programming external connectivity on endpoint
with Docker? Try to restart Docker for Windows!