running this code with mecahnize 2.7.3 and ruby 2.3.0dev:
require 'mechanize'
agent = Mechanize.new
agent.keep_alive = false
agent.open_timeout = 2
agent.read_timeout = 2
agent.ignore_bad_chunking = true
agent.gzip_enabled = false
url = 'http:%5C%5Cwww.scouts.org.uk'
agent.head(url)
Gives me this NoMethodError:
~/.rvm/gems/ruby-head/gems/mechanize-2.7.3/lib/mechanize/http/agent.rb:648:in resolve': undefined
methodlength' for nil:NilClass (NoMethodError)
from ~/.rvm/gems/ruby-head/gems/mechanize-2.7.3/lib/mechanize/http/agent.rb:223:in `fetch'
from ~/.rvm/gems/ruby-head/gems/mechanize-2.7.3/lib/mechanize.rb:459:in `head
Is this a bug in mechanize or am I doing something wrong? If so how can it be fixed?
EDIT: the url is obviously worng, but im reading a lot of urls from a file and some of them might be wrong.
EDIT2: lets say I have a file like this http://pastie.org/9934756 I need to get the head of all the urls that are correct and ignore the others