Shopify / erb_lint

Lint your ERB or HTML files
MIT License
680 stars 122 forks source link

Missing `rexml` gem dependency `cannot load such file -- rexml/document (LoadError)` #381

Closed jana4u closed 2 weeks ago

jana4u commented 1 month ago

rexml was previously added through rubocop, but they recently removed it: https://github.com/rubocop/rubocop/pull/13165

But seems like it is still necessary for ERB Lint itself:

  bundle exec erblint --lint-all
bundler: failed to load command: erblint (/home/runner/work/app/app/vendor/bundle/ruby/3.2.0/bin/erblint)
<internal:/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require': cannot load such file -- rexml/document (LoadError)
    from <internal:/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
    from /home/runner/work/app/app/vendor/bundle/ruby/3.2.0/gems/erb_lint-0.6.0/lib/erb_lint/reporters/junit_reporter.rb:3:in `<top (required)>'

This is when using erb_lint (0.6.0) with rubocop (1.66.1).

This can be "fixed" by adding gem "rexml", require: false to Gemfile, but erb_lint should have its dependencies handled better.

Mangara commented 1 month ago

It looks like it's fixed in https://github.com/Shopify/erb_lint/pull/374, so we just need a new release that contains it.

jana4u commented 2 weeks ago

Fixed in 0.7.0