I am trying to use RSS::Parser to parse an RSS feed, like so:
This works exactly as advertised on my development machine, but on the
production machine RSS::Parser#parse only returns nil. Both machines
are running the same versions of Ruby, and I diffed the rss/ lib
directories on the two machines, and there are no differences (i.e.,
they have the exact same copies of the RSS library code).
The problem is not arising from trying to read the data from a URL. In
fact, nil is returned on the production machine whether the RSS is
read from a URL, a file, or entered directly as a string in the parse
call. The same nil result occurs with even a minimal RSS file.
I even copied the entire Ruby lib directory from the production
machine to my development machine, and ran the code using that library
code like so:
ruby -I/path/to/production/library/code -e "require ‘rss’ ; require
‘rss/parser’ ; puts
It works fine on my development machine with the production library
This is driving me crazy and has wasted so much of my time. Why would
RSS::Parser not be returning an error or some sort of indication of
the problem? Why would it be working on one machine but not on another?
I’m using Ruby 1.8.5 (2006-12-25 patchlevel 12) on both machines. The
development machine is running OS X 10.5, though, and the production
machine is FreeBSD.