gpt4 book ai didi

ruby - hpricot 中的段错误

转载 作者:数据小太阳 更新时间:2023-10-29 08:16:11 24 4
gpt4 key购买 nike

我正在使用 hpricot 来阅读 HTML。我遇到了段错误,我用谷歌搜索,有人说升级到最新版本的 Ruby。我正在使用 rails 2.3.2 和 ruby​​ 1.8.7。如何解决这个错误?

最佳答案

我试图解析其中包含许多 unicode 字符的 html 页面,但 Hpricot 不断崩溃。最后,我使用了 sanitize 的 monkey 补丁并将它放在我的 rails 应用程序的 environment.rb 中。自从我添加了这个补丁后,没有发生过一次崩溃:

http://github.com/rgrove/sanitize/blob/1e1dc9681de99e32dc166f591343dfa60fc1f648/lib/sanitize/monkeypatch/hpricot.rb

关于ruby - hpricot 中的段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/930742/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com