Install Jekyll on a Windows Machine

Earlier this year I found out about this powerful tool that Jekyll is. On its website it is described as “a simple, blog aware, static site generator”. After studying it a bit and learning about all of its advantages I was sure that I wanted to use it to build my personal website. However, the seemingly simple instructions on the home page of its official website didn’t work for me since I use a Windows machine.

Sure enough, I found out that an incredible number of people were struggling with the same problem. Now that I have figured a way around this issue (using some help from the official documentation), I thought I should enlist these easy to follow instructions here.

Step 1. Open Windows powershell as administrator (by typing powershell after clicking on the Windows button, right clicking on the search result, and choosing ‘Run as administrator’ option ).

Step 2. Change the execution policy to unrestricted (or AllSigned) by using the following command.

Set-ExecutionPolicy unrestricted

You can find out more about execution policies by clicking here.

Step 3. Install chocolatey.

iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex

step 1 and 2 installed chocolatey

Step 4. Restart powershell (as administrator).

Step 5. Install Ruby

choco install ruby -y

Step 6. This step has three sub-steps:

i. Download Ruby from the following direct download link:https://rubygems.org/downloads/rubygems-update-2.6.7.gem

I installed it in the C:\Softwares directory.

ii. Now paste the following command. Be sure to change it to specify the correct location of the gem file that you just downloaded.

gem install --local C:\Softwares\rubygems-update-2.6.7.gem

iii. Update Ruby

C:\>update_rubygems --no-ri --no-rdoc

Update ruby

Step 7. Now, all you have to do is follow the Quickstart instructions on the Jekyll website.

gem install jekyll bundler

At this point I changed my directory to where I wanted to make a folder for my website (F:\)

The following command makes a folder (called my-awesome-site) that contains some default files for a Jekyll-based website.

jekyll new my-awesome-site

now running the 3 imprtant commands

Now, wouldn’t you want to check this folder out? cd into it.

cd my-awesome-site

The following command makes Jekyll do its magical interpretations and serve your website on port 4000 (unless you changed the settings in the config file or port 4000 is already in use).

/my-awesome-site $ bundle exec jekyll serve

(For subsequent use type ‘jekyll serve’  instead).

Now browse to http://localhost:4000 (or whatever port Jekyll says it has served your website over) and tada!

If you had any trouble following the instructions outlined above or if there’s some stupid mistake I made, please make a comment and I will take a note of that.

Advertisements

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

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: