Skip to content

Letters seems to have a problem with Nokogiri & XML objects #16

@marcamillion

Description

@marcamillion

I am not using Bundler to manage my dependencies.

I just have a regular script that has a bunch of requires at the top.

    #!/usr/bin/env ruby

    require 'rubygems'
    require 'nokogiri'
    require 'open-uri'
    require 'date'
    require 'pp'
    require 'cgi'
    require 'letters'

This is the LoadError I keep getting:

 LoadError: no such file to load — letters

 method gem_original_require    in custom_require.rb at line 31
 method require in custom_require.rb at line 31

I also ran gem install letters from the CLI in the folder that my script is, and still no dice.

What am I missing?

Thanks.

Edit 1:

By the way, it seems I have the gem installed properly:

$ gem install letters
 Successfully installed letters-0.3.1
 1 gem installed
 Installing ri documentation for letters-0.3.1...
 Installing RDoc documentation for letters-0.3.1...

Edit 2:

I am wondering if there is a conflict between the letters library and one of those other rubygems, because when I open an IRB in that same folder on the command line and I just do require letters and do run the {foo: "bar"}.o example, it works.

So not sure what's happening here. Maybe an issue with Nokogiri?

Edit 3:

Good news and bad news. It seems that the issue is either with Nokogiri or with the XML objects returned by Nokogiri. Here is the output from trying to parse two different URLs with 1 failing and 1 succeeding.

Fail - https://gist.github.com/e4fead2157c1c9559305#file_letters_xml_parse_fail

Succeed - https://gist.github.com/e4fead2157c1c9559305#file_letters_xml_parse_success

The differences are that the fail was trying to parse this URL: http://www.craigslist.org/about/sites and the one that succeeded parsed this URL: http://sfbay.craigslist.org/cpg/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions