Easily install Jekyll on Windows with 3 command prompt entries and Chocolatey
UPDATE 2017/05/17:
I now recommend using the “Windows 10 Subsystem for Linux” which provides an Ubuntu bash shell, to install and use Jekyll. This is how I use it myself.
Install guide is here /2017/05/17/how-to-install-jekyll-on-windows-10-with-windows-subsystem-for-linux/
I've been using Jekyll to create static websites on GitHub Pages, but I was unsure how to install it with dependencies I wasn't used to (NodeJS & Ruby). Here is the easiest way to get Jekyll set up on your machine in just a couple of minutes.
TL;DR if you have Chocolatey installed the 2 commands are:
- choco install ruby -y
- gem install bundler
- gem install jekyll
Prerequisite – Chocolatey
You need to have Chocolatey installed on your machine. Chocolatey is the BEST way to install and keep applications updated on windows.
- Open a command prompt with Administrator access
- Install Chocolatey
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
- Close the command prompt as Chocolatey will not be available until you close and reopen.
Install dependencies & Jekyll
- Open a command prompt with Administrator access
- Install Ruby
choco install ruby -y
- Close and open a new command prompt with Administrator access
- Install gem bundler
gem install bundler - Install Jekyll
gem install jekyll
- UPDATE 2016/12/5: if you get an error about SSL, you will need to manually update Ruby Gems, because their certificate expired… Hopefully the new certificate will be bundled in the future
http://guides.rubygems.org/ssl-certificate-update/
Now you can use standard Jekyll commands to create a new site and serve it e.g.
jekyll new myblog
cd myblog
jekyll serve
Edits:
2016/12/05: Added details on how to get resolve the Ruby Gems certificate expiring. And added gem bundler which is a new requirement.
2015/12/05: From Jekyll 3.0 you do not need to install NodeJS. This brings it down to just 2 command prompt entries to install Jekyll