tenderlove/nokogiri — Issue #612: Nokogiri not parsing/reading HTML file on CentOS
Author: kwhitaker
Created: 2012-02-06 22:04:27+00:00
State: open

I've filed a question @ Stack Overflow, but wanted to put in an issue in case it was something you all were aware of.

Link: http://stackoverflow.com/questions/9167492/nokogiri-not-reading-parsing-structure-of-html-file-in-centos

Our test server is running CentOS 5, with yum installed libxml2 2.6.2. I've installed nokogiri with libxml2 2.7.8, per the tutorial, and I'm using ruby 1.9.2-p0. When I attempt to read in an HTML file in the rails console, however, it isn't parsing. Doing something like this:

```ruby
html = Nokogiri::HTML(open('index.html'))
```

results in an object like this:

```ruby
#]>
```
I know for a fact that this file has several lines of HTML content, but on our CentOS server it isn't getting read in. At first I thought it might have been the libxml2 build, but nokogiri -v returns the following:

```text
# Nokogiri (1.5.0)
---
warnings: []

nokogiri: 1.5.0
ruby:
version: 1.9.2
platform: x86_64-linux
description: ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
engine: ruby
libxml:
binding: extension
compiled: 2.7.8
loaded: 2.7.8
```
I've tried this script on my dev machine (OS X), and it runs just fine. Is there something I'm missing?

Thanks.