Easily install Jekyll on Windows with 2 command prompt entries and Chocolatey

UPDATE 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

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 3 2 commands are:

  1. choco install nodejs -y
  2. choco install ruby -y
  3. gem install jekyll

 

Prerequisite: You need to have Chocolatey installed on your machine. Chocolatey is the BEST way to install and keep applications updated on windows.

  1. Open a command prompt with Administrator access
  2. Install Chocolatey
    @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
  3. Close the command prompt as Chocolatey will not be available until you close and reopen.

 

Install dependencies & Jekyll

  1. Open a command prompt with Administrator access
  2. Install NodeJS
    choco install nodejs -y
  3. Install Ruby
    choco install ruby -y
  4. Close and open a new command prompt with Administrator access
  5. Install Jekyll
    gem install jekyll

Now you can use standard Jekyll commands to create a new site and serve it e.g.
jekyll new myblog
cd myblog
jekyll serve

26 thoughts on “Easily install Jekyll on Windows with 2 command prompt entries and Chocolatey

  1. Hi,

    Just FYI when I tried to install ruby that way I got the error:
    C:\Windows\system32>choco install ruby
    Installing the following packages:
    ruby
    By installing you accept licenses for the packages.
    ruby not installed. The package was not found with the source(s) listed.
    If you specified a particular version and are receiving this message, it is possible that the package name exists but t
    he version does not.
    Version: “”
    Source(s): “https://chocolatey.org/api/v2/”

    Chocolatey installed 0/1 package(s). 1 package(s) failed.
    See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
    Failures:
    – ruby

    The solution was to run the following:
    choco install ruby –version=2.2.4

  2. this is a fantastic tutorial, found via: https://jekyllrb.com/docs/windows/#installation

    One thing that I’m stuck on is post installation and serve I get a warning: “please add the following to your Gemfile to avoid polling for changes: gem ‘wdm’, ‘~> 0.1.0’ if Gem.win_platform?”. The main Jekyll site also recommends this.

    What is the Gemfile, and how do I locate it locally?

  3. The title of this article is really a false advertisment. To install the Ruby, you firstneed Chocholatey. To install that you need powershell.

    The `gem` is another thing you probably need to install, but here the article author doesn’t even bother mention it.

  4. Well, thanks for the guide, this guide works fine by default. But, the mybolg is created under system32. That would be very great if you can add more guides on how to create project in other folder as there are a lot of issues if simply following the original commands.

    I tried to create it to other folder, but encountered a lot of issues. for example, I still need to install bundler, after install it, when I jekyll serve my blog, the page is empty and command message shows lots of files not found:
    Error reading file C:/Tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html: No such file or directory @ rb_sysopen – /Tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html
    Error reading file C:/Tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/page.html: No such file or directory @ rb_sysopen – /Tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/page.html
    Error reading file C:/Tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/post.html: No such file or directory @ rb_sysopen – /Tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/post.html

    Seems it is a path issue, I am an newbie on Ruby. Thanks for any advice.

  5. Thanks for posting! However it was not so “easily” for me.

    Everything went smooth until last step. But issuing “gem install jekyll” brought me this:

    ERROR: Could not find a valid gem ‘jekyll’ (>= 0), here is why:
    Unable to download data from https://rubygems.org/ – SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

    After doing some research I found the solution on the official site:
    http://guides.rubygems.org/ssl-certificate-update/

    And then you can
    7. Start using jekyll
    jekyll new

    But you get a new
    Dependency Error: Yikes! It looks like you don’t have bundler or one of its dependencies installed. In order to use Jekyll as currently configured, you’ll need to install this gem. The full error message from Ruby is: ‘cannot load such file — bundler’ If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
    jekyll 3.3.0 | Error: bundler

    So before that
    6. Install bundler
    gem install bundler

    Hope this helps for anyone coming after me with the same problem🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s