Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting errors using Nokogiri < 1.12 #266

Closed
srussking opened this issue May 10, 2023 · 11 comments · Fixed by #267
Closed

Getting errors using Nokogiri < 1.12 #266

srussking opened this issue May 10, 2023 · 11 comments · Fixed by #267

Comments

@srussking
Copy link

Hi, I am getting the following error:

	 1: from /usr/share/rvm/gems/ruby-2.7.2/gems/loofah-2.21.1/lib/loofah/html4/document.rb:4:in `<module:Loofah>'
/usr/share/rvm/gems/ruby-2.7.2/gems/loofah-2.21.1/lib/loofah/html4/document.rb:10:in `<module:HTML4>': uninitialized constant Nokogiri::HTML4 (NameError)

It seems that Nokogiri added the HTML4 name in version 1.12.x, so upgrading to the latest Nokogiri seems to fix this, but might be better if you were requiring that in your gemspec, which SEEMS to be 1.5.9?

Thanks!

@an280420
Copy link

There seems to be a problem with older versions of ruby.
I use ruby v 2.4.10, nokogiri v 1.10.10 and getting the error

NameError: uninitialized constant Nokogiri::HTML4
Did you mean?  Nokogiri::HTML
....rbenv/versions/2.4.10/lib/ruby/gems/2.4.0/gems/loofah-2.21.1/lib/loofah/html4/document.rb:10:in `<module:HTML4>'

Thanks!

@vrodokanakis
Copy link

It seems it has to do with nokogiri version. Same error on ruby 2.6.8.

Maybe a new version needs to be released, with nokogiri dependency > 12 (instead of >= 1.5.9)? 🙏

Thanks.

@flavorjones
Copy link
Owner

Thanks for the comments, everyone. I'll look into it.

@flavorjones
Copy link
Owner

PR at #267, if all is well I should be able to cut a patch release quickly.

@flavorjones
Copy link
Owner

v2.21.2 has been released fixing this. Thanks for your patience.

@abhisapate
Copy link

@flavorjones won't it still look for v2.21.1 in the case of nokogiri 1.10.10?

@flavorjones
Copy link
Owner

@abhisapate Are you having a problem? I'd be happy to try to help, but I need more information.

@abhisapate
Copy link

Yeah, in case I don't specify the loofah version in Gemfile and we are using Ruby 2.4.10 and nokogiri is locked to 1.10.10.

Before this patch it was fetching loofah v2.21.1 but the dependencies were updated in the patch for v2.21.2, so the bundler will still get the version v2.21.1 which will give me the below error, right?

NameError: uninitialized constant Nokogiri::HTML4
Did you mean?  Nokogiri::HTML
....rbenv/versions/2.4.10/lib/ruby/gems/2.4.0/gems/loofah-2.21.1/lib/loofah/html4/document.rb:10:in `<module:HTML4>'

@sl0thentr0py
Copy link

sl0thentr0py commented May 15, 2023

also seeing this on sentry-ruby
https://github.com/getsentry/sentry-ruby/actions/runs/4829581698/jobs/8913943865

EDIT:

ok just saw the min 2.5 ruby requirement, will fix on our end. you can ignore!

@flavorjones
Copy link
Owner

I'm not yanking these versions of the gem, as yanking tends to be very disruptive to the community. Please pin this dependency in your apps if you're on Ruby 2.4 or earlier, or consider upgrading. Apologies for the inconvenience.

@abhisapate
Copy link

@flavorjones Sure, I'll specify the version in Gemfile. Thanks for the help!

tagliala added a commit to ifad/chronomodel that referenced this issue Jun 2, 2023
loofah >= 2.21.0 raise an issue when starting old Ruby versions

```
lib/loofah/html4/document.rb:10:in `<module:HTML4>': uninitialized constant Nokogiri::HTML4 (NameError)
```

Ref: flavorjones/loofah#266
akariiijima added a commit to akariiijima/activerecord-turntable that referenced this issue Aug 23, 2023
bundle install will install a native gem without any additional action : https://github.com/sparklemotion/nokogiri

loofah should be pin version 2.20.2 :
flavorjones/loofah#266, getsentry/sentry-ruby#2041
akariiijima added a commit to akariiijima/activerecord-turntable that referenced this issue Aug 28, 2023
bundle install will install a native gem without any additional action : https://github.com/sparklemotion/nokogiri

loofah should be pin version 2.20.2 :
flavorjones/loofah#266, getsentry/sentry-ruby#2041
yysaki added a commit to yysaki/okcomputer that referenced this issue Dec 2, 2023
yysaki added a commit to yysaki/okcomputer that referenced this issue Dec 2, 2023
yysaki added a commit to yysaki/okcomputer that referenced this issue Dec 2, 2023
yysaki added a commit to yysaki/okcomputer that referenced this issue Dec 3, 2023
yysaki added a commit to yysaki/okcomputer that referenced this issue Dec 3, 2023
willnet added a commit to willnet/health_check that referenced this issue Oct 31, 2024
- https://github.com/willnet/health_check/actions/runs/11607894411/job/32322128959#step:4:58
> Using nokogiri 1.10.10

- uninitialized constant Nokogiri::HTML4
- [Getting errors using Nokogiri < 1.12 · Issue #266 · flavorjones/loofah](flavorjones/loofah#266) をざっくり見ると、loofarのバージョンで新しいやつにすると、新しいnokogiri(>=1.12.x)にしかない定数を参照してしまう、という話かな
- loofarの2.21.2以降では対応している(nokotiri >=1.12)
- loofarのバージョンを低くする必要があるんだけどいくつだろうな
- ↑ではUsing loofah 2.21.1
	- 2.21.0でLoofar::HTML4が入ったのでそれ未満かな
willnet added a commit to willnet/health_check that referenced this issue Oct 31, 2024
- https://github.com/willnet/health_check/actions/runs/11607894411/job/32322128959#step:4:58
> Using nokogiri 1.10.10

- uninitialized constant Nokogiri::HTML4
- [Getting errors using Nokogiri < 1.12 · Issue #266 · flavorjones/loofah](flavorjones/loofah#266) をざっくり見ると、loofarのバージョンで新しいやつにすると、新しいnokogiri(>=1.12.x)にしかない定数を参照してしまう、という話かな
- loofahの2.21.2以降では対応している(nokotiri >=1.12)
- loofahのバージョンを低くする必要があるんだけどいくつだろうな
- ↑ではUsing loofah 2.21.1
	- 2.21.0でLoofar::HTML4が入ったのでそれ未満かな
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants