[MacRuby] #1182: The Mechanize Gem Fails Under MacRuby But Runs Under Ruby 1.9.2
#1182: The Mechanize Gem Fails Under MacRuby But Runs Under Ruby 1.9.2 ------------------------------------+--------------------------------------- Reporter: dekiefer@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.10 Component: MacRuby | Keywords: Mechanize gem ------------------------------------+--------------------------------------- The following code entered into macirb fails but runs using Ruby 1.9.2 irb: require 'rubygems' require 'Mechanize' agent=Mechanize.new page=agent.gen('http://google.com') -- Ticket URL: <http://www.macruby.org/trac/ticket/1182> MacRuby <http://macruby.org/>
#1182: The Mechanize Gem Fails Under MacRuby But Runs Under Ruby 1.9.2 ------------------------------------+--------------------------------------- Reporter: dekiefer@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.10 Component: MacRuby | Keywords: Mechanize gem ------------------------------------+--------------------------------------- Comment(by cyberfox@…): Greetings, I've gotten Mechanize to work by killing off a few odd pieces. Specifically, if I remove the entire {{{pretty_inspect}}} section (I killed from the 1.8.4 comment down), and I remove {{{require 'mechanize/inspect'}}} from {{{mechanize.rb}}} it works a LOT better. It still doesn't set {{{mech}}} in new instances, so you have to do that by hand. I.e. {{{a = Mechanize.new { |agent| agent.user_agent = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"} b = a.get('http://example.com') b.mech = a c = b.link_with(:text => /text of a link/).href d = a.get(c) d.mech = a puts d.search('td.inf_lab')[1].parent.children[0].content puts d.search('td.inf_lab')[1].parent.children[1].content }}} I'm guessing that the MacRuby failure comes in when it's doing some complex code for inherited instance variables, or something like that. Still, those changes get me able to use Mechanize, with some minor caveats, which is nice... -- Morgan Schweers -- Ticket URL: <http://www.macruby.org/trac/ticket/1182#comment:1> MacRuby <http://macruby.org/>
#1182: The Mechanize Gem Fails Under MacRuby But Runs Under Ruby 1.9.2 ------------------------------------+--------------------------------------- Reporter: dekiefer@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.10 Component: MacRuby | Keywords: Mechanize gem ------------------------------------+--------------------------------------- Comment(by cyberfox@…): Oh...my, that didn't work. :( {{{ a = Mechanize.new { |agent| agent.user_agent = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"} b = a.get('http://example.com') b.mech = a c = b.link_with(:text => /text of a link/).href d = a.get(c) d.mech = a puts d.search('td.inf_lab')[1].parent.children[0].content puts d.search('td.inf_lab')[1].parent.children[1].content }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1182#comment:2> MacRuby <http://macruby.org/>
#1182: The Mechanize Gem Fails Under MacRuby But Runs Under Ruby 1.9.2 ------------------------------------+--------------------------------------- Reporter: dekiefer@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.10 Component: MacRuby | Keywords: Mechanize gem ------------------------------------+--------------------------------------- Comment(by lonny6@…): I'm not sure what you are trying to do with Mechanize, but you might check out bug #1218. There is a quick patch that might get you running again. -- Ticket URL: <http://www.macruby.org/trac/ticket/1182#comment:3> MacRuby <http://macruby.org/>
#1182: The Mechanize Gem Fails Under MacRuby But Runs Under Ruby 1.9.2 ------------------------------------+--------------------------------------- Reporter: dekiefer@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.10 Component: MacRuby | Keywords: Mechanize gem ------------------------------------+--------------------------------------- Comment(by james@…): I was able to get Mechanize running see #1257 -- Ticket URL: <http://www.macruby.org/trac/ticket/1182#comment:4> MacRuby <http://macruby.org/>
#1182: The Mechanize Gem Fails Under MacRuby But Runs Under Ruby 1.9.2 ------------------------------------+--------------------------------------- Reporter: dekiefer@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: minor | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: Mechanize gem | ------------------------------------+--------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: MacRuby 0.10 => MacRuby 0.11 Comment: A fix has been committed, please check out tonight's nightly build and let us know if you still see a problem, in this case we will reopen the ticket and continue to investigate. Thanks! -- Ticket URL: <http://www.macruby.org/trac/ticket/1182#comment:5> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby