jekyll-minimagick icon indicating copy to clipboard operation
jekyll-minimagick copied to clipboard

undefined method `length' for nil:NilClass (NoMethodError)

Open maxvoltar opened this issue 5 years ago • 2 comments

[warning: noob] Have a pretty vanilla Jekyll that was running fine until I tried adding jekyll-minimagick. Here's the error I keep bumping into:

1: from /Users/tim/.rvm/gems/ruby-2.6.3/gems/jekyll-4.0.0/lib/jekyll/static_file.rb:161:in `url' /Users/tim/.rvm/gems/ruby-2.6.3/gems/jekyll-4.0.0/lib/jekyll/static_file.rb:148:in `cleaned_relative_path': undefined method `length' for nil:NilClass (NoMethodError)

Files I've changed:

  • Created _plugins/bundler.rb
  • Created _plugins/my-plugin.rb
  • Added gem "jekyll-minimagick" to :jekyll_plugins in my Gemfile
  • Added this bit to the bottom of _config.yml:
mini_magick:
  thumbnail:
    source: photos/original
    destination: photos/thumbnail
    resize: "640x640"
  tint:
    source: photos/original
    destination: photos/tint
    resize: "1x1"

Anyone has any thoughts? Is this a bug or human error?

maxvoltar avatar Mar 03 '20 18:03 maxvoltar

Ran into similar issues and switched to https://github.com/MattKevan/Jekyll-MiniMagick-new which i first thought will work but running into similar issues atm

dasrecht avatar Mar 17 '20 15:03 dasrecht

Leaving a comment here for future visitors - I had the same issue and ha a decent attempt at trying to debug it. Didn't have any luck with a solution but my hunch was that it's related to the file type/extension not being set correctly on the generated images, which is causing the issue in static_file.rb.

I tried the above linked package which worked perfectly.

FinnLawrence avatar Feb 23 '22 03:02 FinnLawrence