avatar

About me:

I am a .Net developer by day and a bookworm by night. My wife, Collin, is a starving artist and is designing a board game. We have two cats named Katy and Lottie, they're tuxedo cats so they are always dressed for formal affairs.

Sorry, I am not for hire.

rss RSS feed

Jekyll v1.4.3 Hates Windows.

I mentioned in a previous post that I couldn’t use the latest version of Jekyll (v1.4.3 at the time of this post) and included a reference to a stackoverflow post. While what I have to say is nothing you wouldn’t be able to find out on your own by following that thread, maybe I can summarize it for you.

Jekyll commands:

1
2
jekyll build
jekyll serve

Resulted in this nonsense:

1
2
3
4
5
6
7
8
9
C:\Users\campbeja\Projects\campbeja.github.io>jekyll build
 
Configuration file: C:/Users/campbeja/Projects/campbeja.github.io/_config.yml
 
Source: C:/Users/campbeja/Projects/campbeja.github.io
 
Destination: C:/Users/campbeja/Projects/campbeja.github.io/_site
 
Generating... C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Invalid argument - C:/Users/campbeja/Projects/campbeja.github.io/_site/C: (Errno::EINVAL)

Notice the extra C: in the last line? For reasons that I still don’t fully understand, a Ruby script received an invalid file path. I had no idea how, am not familiar with Ruby, and my Google searches failed to find similar reported issues (this was back in December 2013 or January 2014.) Eventually I started looking at Ruby files listed in the stack trace.

Inexperienced with Ruby, I managed to debug by typing print statements throughout the called methods to show values returned, modified, digitally enhanced or whatever. I was lead to Page.rb’s desitination() in the Jekyll source code. Though I identified that it was there that the file path string was getting messed up—I didn’t know how to fix it and by this point I was fed up and focused on something else for a win.

Luckily when I returned to this issue, someone else had reported this issue (see linked stackoverflow post) and Jekyll contributors were already talking about it.

Looks like Windows users will have to stick with version 1.4.2 until Jekyll v2.0.0 is out.

Jekyll Fails to Find Closing Tags in Markup.

As I was adding RSS feed to this blog, I ran into some trouble. Although the my efforts were successful on both master and development branches, my success was limited to my local machine. When I tried to push my changes to GitHub, I received the following build error:

1
The file `_posts/2013-09-07-Jekyll-can-be-tricky-business.markdown` contains markdown errors

Not only couldn’t I reproduce this error locally, but the post in question was published successfully without issue or changes to it since it was published! Since I couldn’t reproduce this error locally, I could not get a stack trace. Even rolling back my changes didn’t get rid of this error, so after reading GitHub’s support documentation with no help, I contacted GitHub support to request a stack trace.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Malformed HTML starting at "<ol>"
| ---------------------------------------------------------------------------
| <ol>EOF
| |---------------------------------------------------------------------------
| +--- Byte 0
| Shown bytes [0 to 4] of 4:
| ><ol>
|
| At line 7
| text |I've worked with Wordpress and Joomla in the past, but Github pages do not support those and their [documentation][github-pages] pointed me to [Jekyll][jekyll].|
| empty ||
| text |Setting up my Jekyll blog was not a simple task for a few reasons:|
| raw_html --> |<ol>|
| code | <li>Jekyll requires Ruby. Ruby doesn't play nice with Windows, which is the only brand of operating system that I use daily.</li>|
| code | <li>If you want syntax highlighting for code snippets, you will need to install &#91;Pygments][pygments-link]. However, in my case, Pygments kept breaking Jekyll. |
| code | After a couple weekends of searching, I still had no solution and chose to just discard it.</li>|
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Maruku cannot parse this block of HTML/XML:
| |<ol>
| &#35;<REXML::ParseException: Missing end tag for 'ol' (got "html")
| Line: 4
| Position: 163
| ...
| Missing end tag for 'ol' (got "html")
| Line: 4
| Position: 163
| Last 80 unconsumed characters:
|
| Line: 4
| Position: 163
\___________________________________________________________________________

As I looked at my source code, I clearly had an end tag for my <ol> list. Even with the stack trace, I still couldn’t duplicate the error on my personal machine, preventing me from viewing the results of my experiments.

One of my attempts to fix my GitHub repo’s build error was to delete the entire repo and try again, a relatively extreme action. This idea was bad because it lost my commit history which would have proved that this error appeared seemingly out of nowhere—so now I am just a crazy person. What gave me this idea came from a past issue that remains unexplained. When writing one of my earlier posts, Jekyll couldn’t build my site due to a markdown error I could not find even with the stack trace, file name, and line number. Running out of ideas, I created another Jekyll site and replaced the contents with those from my site and everything built and displayed without issue. Since GitHub only allows one user page per account (I assumed I’d run into other hiccups if I tried project pages, but I should’ve done that before deleting a repo), I deleted my repo and made it again, but the build error remained.

Eventually, I tried building my site from work. I already had Jekyll installed but never really used it, because we don’t use it at work, and I’m supposed to be… working. I needed a mental break from a project, so I cloned my broken site and built it -or tried to- because I had finally duplicated repo server’s build error! The version of Windows 7 and Ruby are the same as my personal machine but my work machine is running Jekyll v1.2.1, while I have v1.4.2 at home and GitHub as v1.4.3.

Finally being able to duplicate the build error, I came to learn that Jekyll could no longer identify a closing tag a for list or list item if it is not on the same line as its opening tag.

So instead of writing an HTML list like a normal person:

1
2
3
4
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>

You have to write an HTML list like a goober:

1
<ol><li>List item 1</li><li>List item 2</li></ol>

If you look at my source code for this blog post, you’ll see I couldn’t even do {% highlight HTML %} … {% endhighlight %} as advertised in Jekyll’s post documentation because the end result will be HTML div, pre, and code tags that do not begin and end on the same line.

This odd behavior does not appear to apply to <p>, <blockquotes>, or Jekyll v1.4.2 (an older version I had to install for other issues I intend to share later.)