mslinn / jekyll_img

This versatile plugin embeds responsive images using the <picture/> element in documents and pages with alignment options, flexible resizing, default styling, overridable styling, an optional caption, and an optional URL.
https://www.mslinn.com/jekyll_plugins/jekyll_img.html
MIT License
2 stars 0 forks source link

Cannot Load "helper/jekyll_plugin_helper" #12

Closed appleparan closed 4 months ago

appleparan commented 4 months ago

On v0.2.3, I got cannot load file error

/blahblahblah/jekyll_img-0.2.3/lib/jekyll_img.rb:2:in `require': cannot load such file -- helper/jekyll_plugin_helper (LoadError)

The following line become problematic. https://github.com/mslinn/jekyll_img/blob/c15002fe8fd4f9e893c8ca19737594c1363803ef/lib/jekyll_img.rb#L2

Also, I could find helper/jekyll_plugin_helper in https://github.com/mslinn/jekyll_plugin_support/tree/master/lib/helper

Is this a mistake?

mslinn commented 4 months ago

I had encountered that problem, so I rebuilt something on my development machine and the problem went away. The issue occurs when an older version of jekyll_plugin_support is used with a newer version of jekyll_img because I moved some jekyll_plugin_support source files to a subdirectory. While you wait for me to resolve this issue, you could try using an older version of jekyll_img.

The file helper/jekyll_plugin_helper.rb does exist, BTW. Ruby's require automatically appends the .rb extension.

Here is an entry in Gemfile that you could try:

gem 'jekyll_img', '=0.1.6'
mslinn commented 4 months ago

I just tested the latest versions of jekyll_plugin_support (v0.8.5) and jekyll_img (0.2.3), and they worked fine together. However, your Gemfile.lock might specify mixed versions. Here are 2 possible resolutions - please let me know what worked for you:

  1. Use default versions (preferred option)

    a. Edit your Gemfile and remove version specifications for jekyll_plugin_support and jekyll_img, so the entries look like this:

    jekyll_plugin_support
    jekyll_img

    b. Delete Gemfile.lock

    c. Type bundle

  2. Specify versions (last resort option)

    a. Edit your Gemfile and add version specifications, so the entries look like this:

    jekyll_plugin_support, '=0.8.5'
    jekyll_img, '0.2.3'

    b. Delete Gemfile.lock

    c. Type bundle

appleparan commented 4 months ago

I tried both suggestions, but none of them works. The only way to resolve the issue is setting version restriction to older versions. Anyway, my ruby version is 3.1.4 and I also tried reinstalling ruby itself and gems by bundle install --redownload.

Here is my Gemfile and Gemfile.lock. Gemfile.zip

I'm also using jekyll_quote and have the same problem, so I need to downgrade that gem, too.

mslinn commented 4 months ago

I compared the source for what was installed ($HOME/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll_plugin_support-0.8.5/) against $jekyll_plugin_support, and found important discrepancies. I must have published an incorrect version.

I just published jekyll_plugin_support v0.8.6. Please use option #1 above, to use default versions, delete Gemfile.lock, and run bundle. That should cause jekyll_plugin_support v0.8.6 to be installed, and that should solve the problem. Please tell me the results.

appleparan commented 4 months ago

Finally! It worked with option #1. Thank you for your help and fast response!

I close this issue because this issue is now resolved.