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 `delete!' for nil:NilClass #202

Closed
pkra opened this issue May 2, 2017 · 5 comments · Fixed by #203
Closed

undefined method `delete!' for nil:NilClass #202

pkra opened this issue May 2, 2017 · 5 comments · Fixed by #203

Comments

@pkra
Copy link

pkra commented May 2, 2017

Moving this over from github/pages-gem#441.

After updating gh-pages from 134 to 136, I get build errors

  Liquid Exception: undefined method `delete!' for nil:NilClass in /_layouts/default.html

Disabling the SEO plugin resolved this (and was the only relevant update in 136 I could see).

Any pointers would be welcome.

@mmistakes
Copy link

I was bit by the same thing. If you add --verbose and --trace to jekyll build it'll help identify what post/page jekyll-seo-tag is breaking on.

In my case I had posts that had unused stuff like author: false in their YAML Front Matter. Removing those lines fixed my builds.

@pkra The culprits in your repo seem to be the author object. Like in this post

author:
  login: robertm
  email: stevenp@dessci.com
  display_name: Robert Miner
  first_name: Robert
  last_name: Miner

I'm guessing this is all related to the converting the author stuff since into a drop: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-seo-tag-2.2.2/lib/jekyll-seo-tag/drop.rb:91:in author': undefined method delete!' for nil:NilClass (NoMethodErro r)

@pkra
Copy link
Author

pkra commented May 2, 2017

Thanks for debugging this for me @mmistakes! And sorry for not looking into how to get better error information from jekyll 🙇‍♂️.

I should've guessed it's related to the last bug we ran into -- I missed a few posts, apparently.

Leaving it to the maintainers to decide if this is a bug or expected behavior.

@benbalter
Copy link
Collaborator

Fixed via #203. The problem arises when the post has an author hash that contains neither a name nor twitter key. The plugin is attempting to normalize the non-existent Twitter handle by stripping the @.

@pkra
Copy link
Author

pkra commented May 2, 2017

Thanks for the quick response & fix, @benbalter.

@mbrav
Copy link

mbrav commented May 3, 2017

Hi, I'm having a similar problem.

Liquid Exception: undefined method `+' for nil:NilClass in /_layouts/default.html
bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
NoMethodError: undefined method `+' for nil:NilClass

Any suggestions? Here is the beginning of the --trace.

  /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-seo-tag-2.2.2/lib/jekyll-seo-tag/drop.rb:43:in `title'
  /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-seo-tag-2.2.2/lib/jekyll-seo-tag/drop.rb:25:in `title?'
  /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-3.4.3/lib/jekyll/drops/drop.rb:52:in `public_send'
  /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-3.4.3/lib/jekyll/drops/drop.rb:52:in `[]'

mbrav added a commit to mbrav/mbrav.github.io that referenced this issue May 4, 2017
mbrav added a commit to mbrav/mbrav.github.io that referenced this issue May 4, 2017
@jekyll jekyll locked and limited conversation to collaborators Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants