Skip to content

Redirection fails when trying to open remote content using RestClient #331

@fbacall

Description

@fbacall

I recently encountered the following error when trying to parse some JSON-LD:
FATAL Failed to parse input document: loading remote context failed: http://schema.org/: Called from /home/finn/.rvm/gems/ruby-2.2.2@tess-scrapers/gems/json-ld-2.1.0/lib/json/ld/reader.rb:63

after doing some digging, I found that it is actually caused by:

ArgumentError: wrong number of arguments (2 for 0)
/home/finn/.rvm/gems/ruby-2.2.2@tess-scrapers/gems/rest-client-2.0.0/lib/restclient/abstract_response.rb:118:in `follow_redirection'
/home/finn/.rvm/gems/ruby-2.2.2@tess-scrapers/gems/rdf-2.1.0/lib/rdf/util/file.rb:112:in `block in open_url'

which is caused by the following line: https://github.com/ruby-rdf/rdf/blob/develop/lib/rdf/util/file.rb#L100

where the RestClient method actually expects a block: https://github.com/rest-client/rest-client/blob/master/lib/restclient/abstract_response.rb#L118

I'm using the latest stable versions of both gems: ruby-rdf (2.1.0) and rest-client (2.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions