Ruby 1.9.0 and Mechanize


K

Kyle Hunter

Hi all,

I've just downloaded the development release of Ruby 1.9.0.
Unfortunately, url.relative? isn't working well for me.

Any tips or tricks to get Mechanize to work properly would be grand,
thanks.

irb output:
$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'mechanize'
=> true
irb(main):003:0> agent = WWW::Mechanize.new
=> #<WWW::Mechanize:0x4076e220
@cookie_jar=#<WWW::Mechanize::CookieJar:0x4076e20c @jar={}>, @log=nil,
@open_timeout=nil, @read_timeout=nil, @user_agent="WWW-Mechanize/0.7.0
(http://rubyforge.org/projects/mechanize/)", @watch_for_set=nil,
@ca_file=nil, @verify_callback=nil, @cert=nil, @key=nil, @pass=nil,
@redirect_ok=true, @history=[],
@pluggable_parser=#<WWW::Mechanize::pluggableParser:0x4076e1a8
@parsers={"text/html"=>WWW::Mechanize::page},
@default=WWW::Mechanize::File>, @user=nil, @password=nil, @digest=nil,
@auth_hash={}, @digest_response=nil, @proxy_addr=nil, @proxy_pass=nil,
@proxy_port=nil, @proxy_user=nil, @conditional_requests=true,
@follow_meta_refresh=false, @connection_cache={}, @keep_alive_time=300,
@keep_alive=true>
irb(main):004:0> page = agent.get('http://google.com/')
RuntimeError: no history. please specify an absolute URL
from
/home/kylehunter/gems/gems/mechanize-0.7.0/lib/www/mechanize.rb:397:in
`raise'
from
/home/kylehunter/gems/gems/mechanize-0.7.0/lib/www/mechanize.rb:397:in
`to_absolute_uri'
from
/home/kylehunter/gems/gems/mechanize-0.7.0/lib/www/mechanize.rb:164:in
`get'
from (irb):4
from /home/kylehunter/ruby19/lib/ruby/1.9.0/irb.rb:150:in `block (2
levels) in eval_input'
from /home/kylehunter/ruby19/lib/ruby/1.9.0/irb.rb:259:in
`signal_status'
from /home/kylehunter/ruby19/lib/ruby/1.9.0/irb.rb:147:in `block in
eval_input'
from /home/kylehunter/ruby19/lib/ruby/1.9.0/irb.rb:146:in `eval_input'
from /home/kylehunter/ruby19/lib/ruby/1.9.0/irb.rb:70:in `block in
start'
from /home/kylehunter/ruby19/lib/ruby/1.9.0/irb.rb:69:in `catch'
from /home/kylehunter/ruby19/lib/ruby/1.9.0/irb.rb:69:in `start'
from /home/kylehunter/ruby19/bin/irb:13:in `<main>'
irb(main):005:0>
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

:IRB Bug 1
Ruby 1.9 named arguments 5
mechanize login problem 1
each, stuck up... 2
Ruby 1.9, YAML & encodings 0
Ruby 1.9.0 and the debugger 3
Strange bug in irb1.9 7
Problem on an example from ruby-lang.org 1

Top