Liquid 4.0.3 "tainted"

I regularly update my Jekyll environment. This morning much was updated, and an unmentionable strings of errors ensued, the most important hint being libruby.3.1.dylib (LoadError). After unfruitful digging for advice I simply deleted my gems folder, much better.
Now: Jekyll can be started e.g. with jekyll -v (gives 4.3.1), ruby is 3.2.0, but running jekyll serve or similar results in “Liquid Exception: undefined method tainted? …”. I see in the liquid issues this was resolved in liquid ≥5.0, I have liquid-4.0.3. How can I force a “higher” liquid version? I deleted my Gemfile.lock file, but on regenerating I note that it says liquid (~> 4.0) under the jekyll tag.
Please advise. Thanking you in advance, Michael

2 Likes

Adding to my own question… I see from a posting by chuckhoupt “Unfortunately, liquid v5 is not backwards compatible” And I see on GitHub that this is still being worked upon.
So how do I avoid my “tainted” problem? And why does nobody else have the same problem :slight_smile: ?

Or downgrade Jekyll from 4.3.1 to 4.3.0 (which runs well on my other machine), how?

Hello @michaelbach,
This is more of a Ruby issue than a Jekyll issue.
Ruby 3.2.0 has removed a bunch of methods from the top level Object class (all of which were deprecated in previous versions of Ruby). This includes methods such as tainted?. Details can be found in the release post for Ruby 3.2.0.
So, downgrading Jekyll is pointless.

You are not the only facing the issue.

Theoretically, Jekyll could just re-insert the removed methods and cut new release(s). But ideally, Jekyll should not be messing core classes of the language.

The best solution would be getting the Liquid team to release a patch that doesn’t use any of the removed methods in their codebase. That would automatically resolve this issue for ALL fairly recently versions of Jekyll.

1 Like

Thank you for a rapid and clear explanation! I understand. Indeed, in the meantime I had found out how to “downgrade” Jekyll, and, as you say, it did not resolve the issue. Glad to hear I’m not the only one :). Very awkward situation right now for Jekyllers. I’m glad I have a working version (ruby 3.1.2) on another machine…
How will we learn when this is resolved?

Would it help in the meantime to install an older ruby version with, e.g. chruby?

You’re welcome. :slight_smile:
As of now, the only sane solution is to downgrade to an older Ruby version.
There is an open ticket at the Liquid repository at GitHub for response from the devs there. You can subscribe to it to know if the issue will ever get managed.
In the event Liquid declines to patch it’s 4.x series, Jekyll may have to step in and break some rules for users’ sake.

1 Like

Thank you. After several unsuccessful attempts to downgrade Ruby from 3.2.x → 3.1.x (as suggested "on the internet) I simply copied the contents of the directories /opt/homebrew/ and $HOME/gems/ from my other machine to the “accidentally upgraded” one, and all is fine (for now).
The intrepid Jekyll programmers have my full sympathy!

1 Like

@ashmaroli Could I request you update the Jekyll Installation docs to show how to install the “most-supported” version of Ruby, rather than the latest?

Dear Bill: chruby is one possible answer to this… I gave up on it, possibly too early, but then I had the other option (above).

Agreed that it is one option. I am currently using Ubuntu (in a Docker container), so the instructions have you install the latest version of Jekyll. There is no documentation on how to install a specific version. I have been working on this all day since my Jekyll site is not working at the moment and the documentation from the various sites (rbenv docs, etc) are very much lacking. It is taking so much work to figure this out.

1 Like

Any resolutions/workaround/updates here? A series of forced updates (starting with Xcode tools) caused my Jekyll installation to be updated with the tainted package, and I can’t update my website anymore.

Whoops, just found @ashmaroli’s reply on this GH bug:

# in your Gemfile
gem "jekyll", github: "jekyll/jekyll", ref: "refs/pull/9248/head"

This workaround lets me use my site, but reading the patch referenced in that reply, it seems like Liquid 4.0.4 should have fixed this, but I encountered it today after running bundle update. So maybe it wasn’t?

Thanks for alerting us! I ran my full update cycle, and got nasty error on running Jekyll

<internal:/opt/homebrew/Cellar/ruby/3.2.0/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require': dlopen(/Users/bach/gems/gems/pathname-0.2.1/lib/pathname.bundle, 0x0009): Library not loaded: /opt/homebrew/opt/ruby/lib/libruby.3.1.dylib (LoadError)
  Referenced from: <DA0087B6-417D-3DED-8A47-9C4B890B177B> /Users/bach/gems/gems/pathname-0.2.1/lib/pathname.bundle … …

So I simply trashed my $HOME/gems folder, ran full update again. All gems installed, it works! Then simply repeat, problems again, now it complained that liquid-4.0.4 was missing. Indeed there was a liquid-5…. So I used bundle install to put liquid-4.0.4 back, but gem cleanup deletes it!

Whatever, my current solution is:

  • Using @ashmaroli 's patch
    gem "jekyll", github: "jekyll/jekyll", ref: "refs/pull/9248/head"
  • making sure liquid-4.0.4 is present (using bundle install)
  • don’t run gem cleanup (???).

Thus Jekyll 4.3.1 runs fine again. Surely a step forward…