.../_plugins/jekyll_minimagick.rb:7: syntax error, unexpected '<' (SyntaxError)


I am trying to follow the tutorial at


However, my mac’s terminal gives me the following error when I try to bundle exec jekyll build (or bundle exec jekyll serve):

.../_plugins/jekyll_minimagick.rb:7: syntax error, unexpected '<' (SyntaxError)

What can be the reason please?

Also, I believe my installation uses gems, should I make any changes with regards to the tutorial? For example, will Jekyll find my _plugin folder?

I am on Jekyll 3.4.0 by the way, because updating to Jekyll 4 would increases the size by over 100MB. See After updating my Jekyll site from version 3 to 4, my Ruby folder (saasc-2.4.0) becomes very big! How to prevent accumulating precious build time? - Stack Overflow for that other topic.

Make sure you are using ruby 2.6 or 2.7

And I recommend upgrading to jekyll 3.9

As that it what github pages uses and any maintained gems will work with latest Jekyll.

Listen to the error message. It is your friend.

Can you see which line of your file is failing? What does your line 7 see look like? Can you post a link to your plugin file in your repo.

In the script on github, i see a “<” in line 6 not line 7. And that is standard class inheritance so I don’t see an issue.

See if you can ruby the script alone to see if it is a ruby issue and not a Jekyll issue.

ruby _plugins/jekyll_minimagick.rb
# or
bundle exec ruby _plugins/jekyll_minimagick.rb

Also check your own syntax for values that get passed to the plugin.

Maybe you have a YAML value that needs quoting.

  - ">350"