This guide will help you install Jekyll on your Windows machine. We'll cover installing Ruby and DevKit, setting up the environment, and finally installing Jekyll and Bundler.
Install Ruby and DevKit
- Download the Ruby+DevKit installer from the RubyInstaller website (https://rubyinstaller.org/). Choose a version with DevKit included.
- Run the installer. Crucially, check the box to "Install the DevKit" during the installation. This is essential for building native extensions that some Jekyll plugins might require.
After installation, open a new command prompt. Navigate to the DevKit folder (usually located in C:\Ruby27-x64\bin). Run the following command:
ruby dk.rb init
Open the config.yml file in the DevKit folder with a text editor. Uncomment the line that specifies the path to your Ruby installation (e.g., - C:/Ruby27-x64). Save the file.
Install DevKit: In the same command prompt, run:
ruby dk.rb install
Install Jekyll and Bundler
Open a new command prompt. This ensures the changes from the DevKit installation are applied.
Install Jekyll and Bundler using RubyGems:
gem install jekyll bundler
Verify Installation
Check the Jekyll version:
jekyll -v
Create a New Jekyll Site
Create a new directory for your Jekyll site:
mkdir my-jekyll-blog
cd my-jekyll-blog
Initialize a new Jekyll site:
jekyll new .
Run Jekyll Locally
Start the Jekyll server:
bundle exec jekyll serve
Open your web browser and visit http://127.0.0.1:4000/ to see your newly created Jekyll site.
Building Your Site
To build your site for deployment:
bundle exec jekyll build
This will generate a static HTML, CSS, and JavaScript files in the _site directory.
That's it! You've successfully installed Jekyll on your Windows system.
Key Considerations:
- DevKit is crucial: Ensure you install and configure DevKit correctly. Many Jekyll plugins rely on it.
- Use a dedicated command prompt: Always open a new command prompt after installing DevKit or making system changes to ensure the environment is updated.
- Refer to the official documentation: The official Jekyll documentation provides detailed instructions and troubleshooting tips for Windows: jekyllrb.com