nokogiri

Nokogiri 'Failed to build gem native extension' when I run bundle install

假装没事ソ 提交于 2019-11-26 10:08:45
问题 I\'m running bundle install and I\'m getting this error: Building nokogiri using system libraries. Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --use-system-libraries Building nokogiri using system libraries. libxml2 version 2.6.21 or later is required! *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf

Error installing Nokogiri 1.5.0 with rails 3.1.0 and ubuntu

南楼画角 提交于 2019-11-26 09:32:43
问题 Here is the error running bundle install vendor/gems on server: Installing nokogiri (1.5.0) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/dtt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for libxml/parser.h... no ----- libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. ----- *** extconf.rb failed *** Could not create Makefile due to some

Convert a Nokogiri document to a Ruby Hash

[亡魂溺海] 提交于 2019-11-26 06:28:07
问题 Is there an easy way to convert a Nokogiri XML document to a Hash? Something like Rails\' Hash.from_xml . 回答1: I use this code with libxml-ruby (1.1.3). I have not used nokogiri myself, but I understand that it uses libxml-ruby anyway. I would also encourage you to look at ROXML (http://github.com/Empact/roxml/tree) which maps xml elements to ruby objects; it is built atop libxml. # USAGE: Hash.from_libxml(YOUR_XML_STRING) require 'xml/libxml' # adapted from # http://movesonrails.com/articles

Nokogiri/Xpath namespace query

纵然是瞬间 提交于 2019-11-26 05:31:31
问题 I\'m trying to pull out the dc:title element using an xpath. I can pull out the metadata using the following code. doc = <<END <?xml version=\"1.0\" encoding=\"UTF-8\"?> <package xmlns=\"http://www.idpf.org/2007/opf\" version=\"2.0\"> <metadata xmlns:dc=\"URI\"> <dc:title>title text</dc:title> </metadata> </package> END doc = Nokogiri::XML(doc) # Awesome this works! puts \'//xmlns:metadata\' puts doc.xpath(\'//xmlns:metadata\') # => <metadata xmlns:dc=\"URI\"><dc:title>title text</dc:title><

&#39;require&#39;: cannot load such file — &#39;nokogiri\nokogiri&#39; (LoadError) when running `rails server`

独自空忆成欢 提交于 2019-11-26 04:44:13
问题 I\'m running a clean install of Ruby 2.2.1 on Windows 8.1 with DevKit. After the installation I run: gem install rails rails new testapp cd testapp rails server leaving everything else at default. The process fails at the last line when, instead of running the server, I get the error message in \'require\': cannot load such file -- \'nokogiri\\nokogiri\' (LoadError) It happens every time and I\'ve looked around and tried everything I found to fix it, but nothing so far has worked. What is the

Error to install Nokogiri on OSX 10.9 Maverick?

半城伤御伤魂 提交于 2019-11-26 04:33:18
问题 I upgraded my OSX (Lion) to Mavericks and I can\'t install Nokogiri for my projects. I already install XCode 5.0.1, Command Line Tools (using xcode-select --install ), and already installed libxml2 from Homebrew and I am still having problems. The error is: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb checking for libxml/parser.h... *** extconf.rb failed *** Could not create Makefile due

HTML-parser on Node.js [closed]

坚强是说给别人听的谎言 提交于 2019-11-26 02:59:43
问题 Is there something like Ruby\'s nokogiri on nodejs? I mean a user-friendly HTML-parser. I\'d seen on Node.js modules page some parsers, but I can\'t find something pretty and fresh. 回答1: 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