Nokogiri tangle on centos

Source: Internet
Author: User
Tags xslt
# Define the html url url = "http://mp3.baidu.com/" # Get the nokogiri document DOC = nokogiri: HTML (open (URL ))

In centos, the above sentence cannot be parsed, and n writing methods have been tried.

Later I found it was a nokogiri installation problem. If centos5.5 is used, the latest version of libxml2 is still too low. centos is so easy to use and stable, but the library is too old.

Sudo Yum remove-y libxml2 libxslt

Download the latest libxml and libxslt installation here.

Ftp://xmlsoft.org/libxml2/

Gem install/home/Xiao /. rvm/gems/ree-1.8.7-2011.03 @ rails3/Cache/nokogiri-1.4.4.gem -- with-xml2-lib =/opt/libxml2-dev/lib -- with-xml2-include =/opt/libxml2-dev/include/libxml2 -- With-XSLT-Lib =/ OPT/libxslt-dev/lib -- With-XSLT-include =/opt/libxslt-dev/include

Test again, everything is OK.

This is my information.

 [Xiao @ bogon collect] $ nokogiri  - V
---
Warnings: []

Ruby:
Engine: Ruby
Version: 1.8 . 7
Platform: i686 - Linux
Libxml:
Loaded: 2.7 . 8
Binding: Extension
Compiled: 2.7 . 8
Nokogiri: 1.4 . 4
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.