tenderlove/mechanize — Issue #205: Problem with Jruby 1.6.5/6
Author: tcpipmen
Created: 2012-02-20 19:27:03+00:00
State: open

I have a very simple code like below and when run I'm getting error messages. When I switch to Ruby 1.9.2 then it does fine. Is Jruby supported? Please let me know and thanks.

require 'rubygems'
require 'mechanize'
require 'hpricot'

agent = Mechanize.new
page = agent.get('http://www.kumarritesh.com')
@response = page.content
doc = Hpricot(@response)
puts doc

-----------------------------------------------
errors

Java::JavaLang::NullPointerException:
org.jruby.RubyFileStat.setup(RubyFileStat.java:115)
org.jruby.RubyFileStat.newFileStat(RubyFileStat.java:92)
org.jruby.Ruby.newFileStat(Ruby.java:2894)
org.jruby.RubyTempfile.size(RubyTempfile.java:251)
org.jruby.RubyTempfile$i$0$0$size.call(RubyTempfile$i$0$0$size.gen:65535)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:292)