avatar

Shamrat Kumar Paul

shamratpaul@gmail.com


← Back to Blog

Install Jekyll on WSL


Introduction:

Jekyll is a powerful static site generator that allows you to manage websites using plain text files. By using Windows Subsystem for Linux (WSL), you can run a full Jekyll development environment directly on your Windows machine. This guide covers the installation and setup process.

Installation Steps

Open your WSL terminal (e.g., Ubuntu) and run the following commands:

1. Install Ruby and Build Dependencies

sudo apt update
sudo apt install -y ruby-full build-essential zlib1g-dev

2. Configure Local Gem Path

To avoid using sudo for installing gems and to ensure they persist correctly, add these lines to your ~/.bashrc:

echo '# Ruby Gems Environment' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/.gems"' >> ~/.bashrc
echo 'export PATH="$HOME/.gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

3. Install Jekyll and Bundler

gem install jekyll bundler

Creating a New Site

If you are starting a new project:

jekyll new my-awesome-site
cd my-awesome-site
bundle install
bundle exec jekyll serve

Working with an Existing Repository

If you’re maintaining an existing Jekyll site (like a GitHub Pages blog):

cd your-repo-name
bundle install
bundle exec jekyll serve

Your site will be available at http://localhost:4000.


Troubleshooting Tips


Powered by Jekyll and Minimal Light theme.