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

I got a new laptop (Windows 11) and trying to get Jekyll installed correctly on my machine. Everything went well until I tried to run bundle exec jekyll build. I have updated all my gems and jekyll today.

My site is only available behind our corporate firewall.
https://github...corp/pages/hana-tooling/QE-Info/

I thought the issue could be that my posts did not have front matter on it. However, I don’t use the posts section so I deleted everything in that folder. I can see the taint_check method in variable.rb but since I am not really a developer, I am not sure how to fix it. I notice that I have two liquid gems 4.0.3 and 4.0.4, could that be a problem?

PS C:\Users\I826694\QE-Info> bundle exec jekyll build --trace
Configuration file: C:/Users/I826694/QE-Info/_config.yml
Source: C:/Users/I826694/QE-Info
Destination: C:/Users/I826694/QE-Info/_site
Incremental build: disabled. Enable with --incremental
Generating…
Liquid Exception: undefined method tainted?' for nil:NilClass in /_layouts/default.html C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/variable.rb:124:in taint_check’: undefined method `tainted?’ for nil:NilClass (NoMethodError)

  return unless obj.tainted?
                   ^^^^^^^^^
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/variable.rb:89:in `render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:80:in `render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:30:in `block (2 levels) in render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:42:in `measure_bytes'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:29:in `block in render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:49:in `measure_time'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:28:in `render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/tags/include.rb:140:in `block in render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/context.rb:123:in `stack'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/tags/include.rb:137:in `render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in `render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:30:in `block (2 levels) in render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:42:in `measure_bytes'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:29:in `block in render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:49:in `measure_time'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:28:in `render!'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:126:in `render_liquid'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:195:in `render_layout'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:158:in `place_in_layouts'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:88:in `render_document'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:62:in `run'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:479:in `render_regenerated'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:472:in `block in render_pages'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:471:in `each'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:471:in `render_pages'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:192:in `render'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:71:in `process'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/command.rb:28:in `process_site'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:65:in `build'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:36:in `process'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/jekyll-3.9.0/exe/jekyll:15:in `<top (required)>'
    from C:/Ruby32-x64/bin/jekyll:25:in `load'
    from C:/Ruby32-x64/bin/jekyll:25:in `<main>'

maybe. If you google your error you will find some issues about it and they reference the liquid version. It seems like they fixed it with liquid 4.0.4?

Maybe you need to remove liquid 4.03? the error you have is referring to 4.0.3 so that could be it.

That definitely helped. I was googling all morning. Have a new problem now.

Thanks for your help.

Lana