简体   繁体   English

Ruby 2.0中的Nokogiri

[英]Nokogiri in Ruby 2.0

When I require 'nokogiri' in Ruby 2.0, it has a error 当我在Ruby 2.0中require 'nokogiri'时,出现错误

`require': cannot load such file -- nokogiri/2.0/nokogiri (LoadError)

Is nokogiri not supporting Ruby 2.0 yet? nokogiri还不支持Ruby 2.0吗? I can see nokogiri in gem list 我可以在gem list看到nokogiri

Ruby 2.0 support is not yet available for Windows. Ruby 2.0支持尚不适用于Windows。 Follow along here for updates: 请按照此处进行更新:

Yes, it works fine: 是的,它可以正常工作:

RUBY_VERSION # => "2.0.0"
require 'nokogiri'
doc = Nokogiri::HTML('<html><body><p>foo</p></body></html>')
doc.at('p').text # => "foo"

Nokogiri现在甚至在Windows上也支持Ruby 2.0,请点击这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM