Nokogiri in Ruby 2.0

2020-06-21 09:18发布

When I require 'nokogiri' in Ruby 2.0, it has a error

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

Is nokogiri not supporting Ruby 2.0 yet? I can see nokogiri in gem list

标签: ruby nokogiri
3条回答
Fickle 薄情
2楼-- · 2020-06-21 09:33

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"
查看更多
▲ chillily
3楼-- · 2020-06-21 09:41

Nokogiri now support Ruby 2.0, even on Windows, see HERE

查看更多
地球回转人心会变
4楼-- · 2020-06-21 09:45

Ruby 2.0 support is not yet available for Windows. Follow along here for updates:

查看更多
登录 后发表回答