NameError:未初始化的常量 Nokogiri::HTML::DocumentFragment
大约三个小时前,我开始在我的生产服务器中看到上述错误。它来自对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试降级到“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.