NameError:未初始化的常量 Nokogiri::HTML::DocumentFragment

发布于 2024-08-28 10:02:07 字数 827 浏览 10 评论 0原文

大约三个小时前,我开始在我的生产服务器中看到上述错误。它来自对 sanitize gem 的调用:

vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:276:in 'load_missing_constant'
vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:468:in `const_missing'
vendor/gems/sanitize-1.2.0/lib/sanitize.rb:91:in `clean!'
vendor/gems/sanitize-1.2.0/lib/sanitize.rb:84:in `clean'
vendor/gems/sanitize-1.2.0/lib/sanitize.rb:49:in `clean'   
app/helpers/application_helper.rb:28:in `display_none'
app/views/main/_blogs.html.erb:13:in `_run_erb_47app47views47main47_blogs46html46erb'

该错误仅发生在生产服务器(linux)上,而不是我的开发机器(windows)上。

我尝试回滚我的最新部署,但没有修复它。

我已更新到 sanitize 1.2.0(这是由 gem update sanitize 带来的最新版本,尽管我注意到我的主机正在运行 1.3.6。

任何人都可以提供任何线索来帮助解决此问题吗?

About three hours ago I started seeing the above error in my production server. It comes from a call to the sanitize gem:

vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:276:in 'load_missing_constant'
vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:468:in `const_missing'
vendor/gems/sanitize-1.2.0/lib/sanitize.rb:91:in `clean!'
vendor/gems/sanitize-1.2.0/lib/sanitize.rb:84:in `clean'
vendor/gems/sanitize-1.2.0/lib/sanitize.rb:49:in `clean'   
app/helpers/application_helper.rb:28:in `display_none'
app/views/main/_blogs.html.erb:13:in `_run_erb_47app47views47main47_blogs46html46erb'

The error only occurs on the production server (linux), not my development machine (windows)

I tried rolling back my latest deployment but it didn't fix it.

I've updated to sanitize 1.2.0 (which was the latest version brought down by gem update sanitize, though I note my host is running 1.3.6.

Can anyone provide any clues to help fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情话已封尘 2024-09-04 10:02:07

尝试降级到“1.0.8”。请参阅历史记录并注意切换到使用Nokogiri。如果这解决了问题,请确保您安装了最新版本的 Sanitize、Nokogiri 1.4.1 和 libxml2 2.7.2。

Try downgrading to '1.0.8'. See the history and note the switch to using Nokogiri. If this fixes the issue, ensure you have the latest version of Sanitize, Nokogiri 1.4.1 and libxml2 2.7.2 installed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文