‘require’: cannot load such file — ‘nokogiri\nokogiri’ (LoadError) when running `rails server`

Nokogiri doesn’t support Ruby 2.2 on Windows yet. The next release will. See https://github.com/sparklemotion/nokogiri/issues/1256 Nokogiri doesn’t support native builds (e.g. with devkit) on Windows. Instead it provides gems containing prebuilt DLLs. There’s a discussion which you may want to join or watch on the topic of devkit build support here: https://github.com/sparklemotion/nokogiri/issues/1190

Error to install Nokogiri on OSX 10.9 Maverick?

You can also install Nokogiri on Mac OS X 10.9 Mavericks with full XCode Install using: gem install nokogiri — –with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 Update For those using Yosemite the following command will work: gem install nokogiri — –with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 –use-system-libraries or, it might actually be in your MacOSX10.11.sdk folder (mine was as of 18-Sep-2015) anyways, so even if … Read more

HTML-parser on Node.js [closed]

If you want to build DOM you can use jsdom. There’s also cheerio, it has the jQuery interface and it’s a lot faster than older versions of jsdom, although these days they are similar in performance. You might wanna have a look at htmlparser2, which is a streaming parser, and according to its benchmark, it … Read more

How to avoid joining all text from Nodes when scraping

This is an easily solved problem that results from not reading the documentation about how text behaves when used on a NodeSet versus a Node (or Element). The NodeSet documentation says text will: Get the inner text of all contained Node objects Which is what we’re seeing happen with: doc = Nokogiri::HTML(<<EOT) <html> <body> <p>foo</p> … Read more