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

Bug: NoMethodError: undefined method `[]' for nil:NilClass #40

Closed
0xdevalias opened this issue Jul 14, 2017 · 4 comments
Closed

Bug: NoMethodError: undefined method `[]' for nil:NilClass #40

0xdevalias opened this issue Jul 14, 2017 · 4 comments
Labels

Comments

@0xdevalias
Copy link
Contributor

If I wipe my cache folder, and run the below command, it seems to work properly (at least doesn't crash). The 2nd time I run it, I get the following.

I'm also not seeing any actual mentions, even though I am pretty certain there should be (querying webmention.io for my domain using the key shows me a number that don't show up)

⇒  JEKYLL_ENV=development jekyll serve --drafts --trace
Configuration file: /Users/devalias/dev/devalias.net/_config.yml
Configuration file: /Users/devalias/dev/devalias.net/_config.yml
Configuration file: /Users/devalias/dev/devalias.net/_config.yml
            Source: /Users/devalias/dev/devalias.net
       Destination: /Users/devalias/dev/devalias.net/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
[jekyll-webmention_io] Beginning to gather webmentions of your posts. This may take a while.
bundler: failed to load command: jekyll (/Users/devalias/.rbenv/versions/2.3.0/bin/jekyll)
NoMethodError: undefined method `[]' for nil:NilClass
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-webmention_io-2.5.0/lib/jekyll/generators/gather_webmentions.rb:52:in `block in generate'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-webmention_io-2.5.0/lib/jekyll/generators/gather_webmentions.rb:44:in `each'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-webmention_io-2.5.0/lib/jekyll/generators/gather_webmentions.rb:44:in `generate'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/site.rb:174:in `block in generate'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/site.rb:172:in `each'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/site.rb:172:in `generate'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/site.rb:68:in `process'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/command.rb:26:in `process_site'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/commands/build.rb:63:in `build'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-admin-0.4.1/lib/jekyll/commands/build.rb:9:in `build'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/commands/build.rb:34:in `process'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/commands/serve.rb:37:in `block (2 levels) in init_with_program'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
  /Users/devalias/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/jekyll-3.4.3/exe/jekyll:13:in `<top (required)>'
  /Users/devalias/.rbenv/versions/2.3.0/bin/jekyll:23:in `load'
  /Users/devalias/.rbenv/versions/2.3.0/bin/jekyll:23:in `<top (required)>'
@aarongustafson
Copy link
Owner

aarongustafson commented Jul 17, 2017

I have a test bugfix for this. I’m pushing it to the bugfixes-2017-07-17 branch. Can you the gem from a local source and let me know if this fixes the issue?

https://github.com/aarongustafson/jekyll-webmention_io/tree/bugfixes-2017-07-17

aarongustafson added a commit that referenced this issue Jul 17, 2017
@0xdevalias
Copy link
Contributor Author

0xdevalias commented Jul 18, 2017

Testing that version, seems to no longer get the nil error

[jekyll-webmention_io] Beginning to gather webmentions of your posts. This may take a while.
[jekyll-webmention_io] Webmentions have been gathered and cached.
[jekyll-webmention_io] Beginning to gather webmentions you’ve made. This may take a while.
[jekyll-webmention_io] Webmentions have been gathered and cached.
                    done in 87.057 seconds.

Takes an extremely long time to go through though :(

Also, still not seeing any mentions for my URLs in the cache when I know there definitely should be some.

They look like this:

..snip..
"/devalias/2017/03/01/biohacked-box-2/": {}
"/devalias/2017/03/18/iterm-tmux-love/": {}
"/devalias/2017/07/14/link-dump-clearing-out-my-todo-list/": {}
"/devalias/2017/07/16/bugcrowd-levelup-2017/": {}

Is that right? Where/how is it reading the domain/etc?

webmentions:
  username: devalias.net

@aarongustafson
Copy link
Owner

Takes an extremely long time to go through though :(

It should speed up over time.

Is that right?

Yep.

Where/how is it reading the domain/etc?

It pulls the domain from the _config.yml file url value. It also factors in webmentions.legacy_domains.

@0xdevalias
Copy link
Contributor Author

Cool, I need to do some digging to see exactly what the URL structure of the old mentions was then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants