Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `[]' for nil:NilClass #60

Closed
fred-o opened this issue May 20, 2015 · 7 comments
Closed

undefined method `[]' for nil:NilClass #60

fred-o opened this issue May 20, 2015 · 7 comments

Comments

@fred-o
Copy link

fred-o commented May 20, 2015

I'm running into

 undefined method `[]' for nil:NilClass

when trying to run any ink command (even list). The full stack trace is

/Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-date-format-3.0.2/lib/octopress-date-format.rb:78:in `format_date': undefined method `[]' for nil:NilClass (NoMethodError)
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-date-format-3.0.2/lib/octopress-date-format.rb:42:in `hack_date'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-date-format-3.0.2/lib/octopress-date-format.rb:27:in `post_init'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:374:in `block in post_init'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:373:in `each'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:373:in `post_init'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:325:in `initialize'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `new'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `block in read_content'        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `map'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `read_content'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:195:in `read_posts'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:167:in `read_directories'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-asset-pipeline-2.0.4/lib/octopress-asset-pipeline.rb:30:in `add_files'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-asset-pipeline-2.0.4/lib/octopress-asset-pipeline.rb:24:in `register'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink/plugins.rb:59:in `each'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink/plugins.rb:59:in `register'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink.rb:134:in `list'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink/commands/list.rb:14:in `block (2 levels) in process_command'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-3.0.5/bin/octopress:8:in `<top (required)>'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/bin/octopress:23:in `load'        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/bin/octopress:23:in `<main>'

I assume this has something to do with date formatting, and as far as I can see the config object seems to be missing in octopress-date-format. This used to work until a recent gem upgrade.

Relevant gem versions:

  * octopress (3.0.5)
  * octopress-asset-pipeline (2.0.4)
  * octopress-assign-tag (1.0.3)
  * octopress-autoprefixer (1.0.1)
  * octopress-categories (0.0.1)
  * octopress-code-highlighter (4.2.4)
  * octopress-codeblock (1.0.5)
  * octopress-codefence (1.6.1)
  * octopress-comment-tag (1.0.1)
  * octopress-content-for (1.0.4)
  * octopress-date-format (3.0.2)
  * octopress-deploy (1.2.4)
  * octopress-escape-code (2.0.6)
  * octopress-feeds (2.0.4)
  * octopress-filter-tag (1.0.2)
  * octopress-filters (1.3.3)
  * octopress-genesis-theme (0.0.10)
  * octopress-hooks (2.6.1)
  * octopress-image-tag (1.1.0)
  * octopress-include-tag (1.1.3)
  * octopress-ink (1.1.4)
  * octopress-linkblog (2.0.2)
  * octopress-littlefoot (1.0.1)
  * octopress-paginate (1.1.2)
  * octopress-pullquote-tag (1.0.1)
  * octopress-quote-tag (1.0.4)
  * octopress-render-tag (1.0.7)
  * octopress-return-tag (1.0.1)
  * octopress-social (1.4.5)
  * octopress-solarized (1.1.2)
  * octopress-tag-helpers (1.0.7)
  * octopress-wrap-tag (1.1.1)
@imathis
Copy link
Member

imathis commented May 26, 2015

Gah, sorry I missed this. Taking a look into it now.

@imathis
Copy link
Member

imathis commented May 26, 2015

I've released a new version of octopress-date-format would you mind updating your gems and seeing if that is still a problem?

@fred-o
Copy link
Author

fred-o commented May 26, 2015

Yeah, I still get the same stack trace unfortunately.

@imathis
Copy link
Member

imathis commented May 26, 2015

I think this may have been due an issue with the Octopress gem. I've released Octopress 3.0.6 this morning. Would you mind updating and letting me know if that helps?

@imathis
Copy link
Member

imathis commented May 26, 2015

If not, post your Gemfile and I'll see if I can reproduce it locally with a fresh site.

@fred-o
Copy link
Author

fred-o commented Jun 1, 2015

Works like a charm. Thank you! :)

@imathis
Copy link
Member

imathis commented Jun 1, 2015

Sweet. Thanks for checking back in!

@imathis imathis closed this as completed Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants