octopress / linkblog

Adds link blogging features, along with some other niceties, to any Jekyll site.
MIT License
20 stars 12 forks source link

Error: post.data['title'] is nil #2

Closed oflannabhra closed 9 years ago

oflannabhra commented 9 years ago

I'm trying to run jekyll serve and am running into an error (stack trace below). It looks like the error is in this gem, but I'm not sure it's related to it. The error occurs in this line. It looks like post.data['title'] is nil, which makes me think that PostHook is getting initialized as nil? My ruby-fu is pretty weak, but I figured I'd report it here (I know all this is very alpha, sorry if reporting is getting in the way. Thanks for building such an amazing ecosystem!)

/Library/Ruby/Gems/2.0.0/gems/octopress-linkblog-1.2.0/lib/octopress-linkblog.rb:42:in `add_post_vars': undefined method `titlecase!' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/octopress-linkblog-1.2.0/lib/octopress-linkblog.rb:36:in `post_init'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-hooks-2.4.1/lib/octopress-hooks.rb:346:in `block in post_init'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-hooks-2.4.1/lib/octopress-hooks.rb:345:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-hooks-2.4.1/lib/octopress-hooks.rb:345:in `post_init'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-hooks-2.4.1/lib/octopress-hooks.rb:297:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `block in read_content'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `map'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `read_content'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:195:in `read_posts'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:167:in `read_directories'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:151:in `read'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-hooks-2.4.1/lib/octopress-hooks.rb:151:in `read'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:49:in `process'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /Library/Ruby/Gems/2.0.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /usr/bin/jekyll:23:in `load'
    from /usr/bin/jekyll:23:in `<main>'
imathis commented 9 years ago

Hey, thanks for the report. Do you have any posts without a title in the YAML front-matter? If you can do the old, remove posts until it builds without error, perhaps you can figure out which is causing the problem and I can add a test case for that scenario (if it's not an error on your part).

oflannabhra commented 9 years ago

haha! I just came back to post that adding titles resolved it, lol. I'm still getting some nil:NilClass errors, but I think those are related to other issues in my setup... closing this as resolved.