Last active
December 16, 2015 15:29
-
-
Save jonforums/5456209 to your computer and use it in GitHub Desktop.
jekyll's wasting my time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I run a patched 0.11.2 jekyll environment (patched posix-spawn) on my local win7 box because of | |
breaking changes the devs made in the past that impact windows users. Hard to tell if they even | |
tested on windows boxes before pushing. Perhaps things are different with the recent commit activity. | |
And no time to confirm whether they're doing the right things for jekyll-on-windows users, or just | |
hoping all the recent commits for all the dependencies Just Work. | |
After a long hiatus, I just pushed a post (worked on my local 0.11.2 jekyll setup) about Go's | |
fantastic cross-build capabilities and was rewarded with this exciting email from GH: | |
Subject: [jonforums.github.com] Page build failure | |
Date: Wed, 24 Apr 2013 14:50:50 -0700 | |
The page build failed with the following error: | |
page build failed | |
For information on troubleshooting Jekyll see https://help.github.com/articles/using-jekyll-with-pages#troubleshooting | |
If you have any questions please contact GitHub Support. | |
Amazing. The phrase you're searching for is...Can this be any less fk'n helpful!? | |
Even though the Go post displayed perfectly on my local system, perhaps I did punt the syntax and | |
it's my fault. But *no one* will ever know from that pathetic error message. | |
Fine. Time to find out what new ways jekyll has found to break things on my windows box. Or discover | |
I've got a really bad attitude toward jekyll. The help docs say GH is using jekyll `=0.12.0` so let's | |
try a fresh install of the GH configuration: | |
C:\>gem i jekyll --version 0.12.0 | |
Fetching: liquid-2.5.0.gem (100%) | |
Successfully installed liquid-2.5.0 | |
Temporarily enhancing PATH to include DevKit... | |
Building native extensions. This could take a while... | |
Successfully installed fast-stemmer-1.0.2 | |
Fetching: classifier-1.3.3.gem (100%) | |
Successfully installed classifier-1.3.3 | |
Fetching: directory_watcher-1.5.1.gem (100%) | |
Successfully installed directory_watcher-1.5.1 | |
Fetching: syntax-1.0.0.gem (100%) | |
Successfully installed syntax-1.0.0 | |
Fetching: maruku-0.6.1.gem (100%) | |
Successfully installed maruku-0.6.1 | |
Fetching: kramdown-0.13.8.gem (100%) | |
Successfully installed kramdown-0.13.8 | |
Fetching: yajl-ruby-1.1.0-x86-mingw32.gem (100%) | |
Successfully installed yajl-ruby-1.1.0-x86-mingw32 | |
Fetching: posix-spawn-0.3.6.gem (100%) | |
Building native extensions. This could take a while... | |
Successfully installed posix-spawn-0.3.6 | |
Fetching: pygments.rb-0.3.7.gem (100%) | |
Successfully installed pygments.rb-0.3.7 | |
Fetching: jekyll-0.12.0.gem (100%) | |
Successfully installed jekyll-0.12.0 | |
11 gems installed | |
Great, no install errors. I know, I know, you're asking the same questions I am like | |
"11 gems to install to get jekyll working?" and "What's this posix-spawn gem doing getting | |
installed on my windows box?" | |
But no matter, lets test out the new post and find out what's wrong | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll --server 8080 | |
C:/ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- yajl/2.0/yajl (LoadError) | |
from C:/ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' | |
from C:/ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib/yajl/yajl.rb:2:in `<top (required)>' | |
Great, jekyll'd again! Well not quite. Did you catch the real error? It's our good friend yajl-ruby | |
choking on ruby 2.0.0 on windows because it's binary gem only provides 1.8 and 1.9 pieces and | |
hasn't yet upgraded to support 2.0.0. | |
OK, another time wasting setup when I-JUST-WANTED-TO-PUSH-A-SIMPLE-POST. Dammit. | |
Breathe.... | |
I don't want to pollute my ruby 1.9.3 install (with patched jekyll 0.11.2 env) by trying to install | |
jekyll 0.12.0, so let's try this: | |
C:\>gem i yajl-ruby --platform=ruby | |
Fetching: yajl-ruby-1.1.0.gem (100%) | |
Temporarily enhancing PATH to include DevKit... | |
Building native extensions. This could take a while... | |
Successfully installed yajl-ruby-1.1.0 | |
1 gem installed | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll --safe --server 8080 | |
Configuration from C:/Users/Jon/Documents/WebDev/jonforums.github.com/_config.yml | |
Building site: C:/Users/Jon/Documents/WebDev/jonforums.github.com -> C:/Users/Jon/Document | |
s/WebDev/jonforums.github.com/_site | |
Successfully generated site: C:/Users/Jon/Documents/WebDev/jonforums.github.com -> C:/User | |
s/Jon/Documents/WebDev/jonforums.github.com/_site | |
[2013-04-24 18:59:02] INFO WEBrick 1.3.1 | |
[2013-04-24 18:59:02] INFO ruby 2.0.0 (2013-04-23) [i386-mingw32] | |
[2013-04-24 18:59:02] INFO WEBrick::HTTPServer#start: pid=1332 port=8080 | |
Red - - [24/Apr/2013:19:06:35 Eastern Daylight Time] "GET / HTTP/1.1" 200 133919 - -> / | |
Red - - [24/Apr/2013:19:06:36 Eastern Daylight Time] "GET /css/syntax.css HTTP/1.1" 200 3264 | |
http://localhost:8080/ -> /css/syntax.css | |
... | |
OK, this looks about right and the page displayed correctly. So why is GH failing to build? Do I | |
have a file in my local repo that didn't get committed to my GH repo? Something else? | |
C:\>gem out | |
jekyll (0.12.0 < 0.12.1) | |
pygments.rb (0.3.7 < 0.5.0) | |
Let's bump jekyll and friends to the latest versions and try again. Perhaps the GH doco is outdated | |
and GH is running with jekyll 0.12.1 and newer friends and things are failing. | |
C:\>gem up jekyll pygments.rb | |
Updating installed gems | |
Updating jekyll | |
Fetching: kramdown-0.14.2.gem (100%) | |
Successfully installed kramdown-0.14.2 | |
Fetching: jekyll-0.12.1.gem (100%) | |
Successfully installed jekyll-0.12.1 | |
Updating pygments.rb | |
Fetching: pygments.rb-0.5.0.gem (100%) | |
Successfully installed pygments.rb-0.5.0 | |
Gems updated: kramdown jekyll pygments.rb | |
C:\>gem clean | |
Cleaning up installed gems... | |
Attempting to uninstall jekyll-0.12.0 | |
Successfully uninstalled jekyll-0.12.0 | |
Attempting to uninstall kramdown-0.13.8 | |
Successfully uninstalled kramdown-0.13.8 | |
Clean Up Complete | |
Survey says!? | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll --version | |
Jekyll 0.12.1 | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll --safe --server 8080 | |
Configuration from C:/Users/Jon/Documents/WebDev/jonforums.github.com/_config.yml | |
Building site: C:/Users/Jon/Documents/WebDev/jonforums.github.com -> C:/Users/Jon/Documents/WebDev/jonforums.github.com/_site | |
Successfully generated site: C:/Users/Jon/Documents/WebDev/jonforums.github.com -> C:/Users/Jon/Documents/WebDev/jonforums.github.com/_site | |
[2013-04-24 19:49:50] INFO WEBrick 1.3.1 | |
[2013-04-24 19:49:50] INFO ruby 2.0.0 (2013-04-23) [i386-mingw32] | |
[2013-04-24 19:49:50] INFO WEBrick::HTTPServer#start: pid=2756 port=8080 | |
Red - - [24/Apr/2013:19:50:01 Eastern Daylight Time] "GET / HTTP/1.1" 200 133919- -> | |
Nope. All runs well and looks well with the latest gems on Win7 32-bit with ruby 2.0.0p158. | |
Where do things currently stand? | |
1. Jekyll on GH is failing to build my latest post. | |
2. GH page build failure notices are unhelpful in this case. | |
3. My latest post builds fine on win7 32-bit with the following rubies: | |
* 1.9.3p415: jekyll 0.11.2 + patched posix-spawn | |
* 2.0.0p158: jekyll 0.12.0 | |
* 2.0.0p158: jekyll 0.12.1 | |
4. The issue appears to have nothing to do with jekyll on windows and I'm likely to | |
have to eat some crow suggesting Team Jekyll isn't paying attention to the windows | |
platform. If they're not testing on windows, they're getting extremely lucky ;) | |
Is GH testing jekyll 1.0.0.rc1 and my post is crashing the build? Who knows, I'll try it later. | |
Time to call in the gurus at [email protected] | |
While the GH gurus are taking a look at things, let's check out jekyll 1.0.0.rc1 shall we... | |
C:\Users\Jon\Documents>gem i jekyll --pre | |
Fetching: directory_watcher-1.4.1.gem (100%) | |
Successfully installed directory_watcher-1.4.1 | |
Fetching: pygments.rb-0.4.2.gem (100%) | |
Successfully installed pygments.rb-0.4.2 | |
Fetching: highline-1.6.18.gem (100%) | |
Successfully installed highline-1.6.18 | |
Fetching: commander-4.1.3.gem (100%) | |
Successfully installed commander-4.1.3 | |
Fetching: safe_yaml-0.7.1.gem (100%) | |
Successfully installed safe_yaml-0.7.1 | |
Fetching: colorator-0.1.gem (100%) | |
Successfully installed colorator-0.1 | |
Fetching: jekyll-1.0.0.rc1.gem (100%) | |
Successfully installed jekyll-1.0.0.rc1 | |
7 gems installed | |
Nooooooooooooo...look at all those new dependencies. It's looking like Gem Hell time for jekyll. Sigh. | |
Ok. Let's see how things look. | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll --version | |
jekyll 1.0.0.rc1 | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll --safe --server 8080 | |
Deprecation: The --server command has been replaced by the 'serve' subcommand. | |
C:/ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:365:in `block | |
in require_program': program version required (Commander::Runner::CommandError) | |
from C:/ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:364:in `each' | |
OK, let's try the new cmd line format. | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll serve --port 8080 | |
Configuration file: C:/Users/Jon/Documents/WebDev/jonforums.github.com/_config.yml | |
Source: C:/Users/Jon/Documents/WebDev/jonforums.github.com | |
Destination: C:/Users/Jon/Documents/WebDev/jonforums.github.com/_site | |
Generating... Liquid Exception: undefined method `xmlschema' for "2012-12-19T00:57:47-05:00":String in atom.xml | |
C:/ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.0.rc1/lib/jekyll/filters.rb:56:in `date_to_xmlschema' | |
C:/ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/strainer.rb:43:in `invoke' | |
... | |
Build Failed | |
Ah, finally a failure. Looks like the GH folks did a soft rollout of jekyll 1.0.0.rc1 (good thing) and | |
it doesn't like a date format in my jekyll generated `atom.xml` that used to work. Or maybe something | |
in the `date_to_schema` filter as I use markup like this in my `atom.xml` template: | |
<updated>{{ site.time | date_to_xmlschema }}</updated> | |
C'mon folks, stop wasting my time. You had perfectly good failure info but sent sent me an email with | |
"page build failed." You can do better than this. | |
After some good discussion at https://github.com/mojombo/jekyll/issues/997 I made this quick hack | |
available at http://paste.ubuntu.com/5601947/ | |
diff --git a/filters.rb.orig b/filters.rb | |
index 37d4f1c..27f4e1b 100644 | |
--- a/filters.rb.orig | |
+++ b/filters.rb | |
@@ -1,3 +1,4 @@ | |
+require 'date' | |
require 'uri' | |
module Jekyll | |
@@ -53,7 +54,12 @@ module Jekyll | |
# | |
# Returns the formatted String. | |
def date_to_xmlschema(date) | |
- date.xmlschema | |
+ case date | |
+ when String | |
+ DateTime.xmlschema(date) | |
+ when Date | |
+ date.xmlschema | |
+ end | |
end | |
# Format a date according to RFC-822 | |
and jekyll 1.0.0.rc1 correctly built and displayed my post on win7 32-bit with ruby 2.0.0p158. Yea! | |
I don't know the jekyll codebase well enough to know if the quick hack is good or bad, but 1.0.0.rc1 | |
and friends are working for me. | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll --version | |
jekyll 1.0.0.rc1 | |
C:\Users\Jon\Documents\WebDev\jonforums.github.com>jekyll serve --port 8080 | |
Configuration file: C:/Users/Jon/Documents/WebDev/jonforums.github.com/_config.yml | |
Source: C:/Users/Jon/Documents/WebDev/jonforums.github.com | |
Destination: C:/Users/Jon/Documents/WebDev/jonforums.github.com/_site | |
Generating... done. | |
[2013-04-25 14:16:39] INFO WEBrick 1.3.1 | |
[2013-04-25 14:16:39] INFO ruby 2.0.0 (2013-04-23) [i386-mingw32] | |
[2013-04-25 14:16:39] INFO WEBrick::HTTPServer#start: pid=2872 port=8080 | |
trackers.localhost - - [25/Apr/2013:14:16:45 Eastern Daylight Time] "GET / HTTP/1.1" 200 146283 | |
- -> / | |
... | |
...TO BE CONTINUED |
I just found this gist while googling around trying to figure out why the example starter snippet on http://jekyllrb.com/ wasn't working.
Conclusion: still broken
I'm trying to begin my quest on static-blog-websites.... but struggling to launch any as well.
Jekyll doesn't seems to work properly (or at all) with windows+ruby 2.0.
Octopress was another nigthmare to install.
Guess I will return to wordpress after all...
:o(
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Attempting to use jekyll on Windows is my first experience with using Ruby infrastructure and package management and it is leaving a bad taste in my mouth, which is why I found this page. Per this question on stackoverflow and this ticket, it appears that
yajl
isn't support on version 2.0* of Ruby.