I have a JRuby 1.1.5 program that works fine on OS X but I can’t get
it to work on Windows.
When I try to require ‘webrick’ I get the following error:
C:/Program Files/path with
‘quote/java/lib/ruby/1.8/webrick/config.rb:13:in `require’: IO error
– webrick/httputils (LoadError)
from C:/Program Files/path with
'quote/java/lib/ruby/1.8/webrick/config.rb:13
So I started debugging and discovered the real point of failure seems
to be calling
require ‘socket’
which gives the following error:
java.lang.IllegalArgumentException: Neither current working directory
() nor pathname (socket.class) led to an absolute path
at
org.jruby.util.JRubyFile.createNoUnicodeConversion(JRubyFile.java:60)
at org.jruby.util.JRubyFile.create(JRubyFile.java:49)
at
org.jruby.runtime.load.LoadService.tryResourceFromLoadPath(LoadService.java:839)
at
org.jruby.runtime.load.LoadService.tryResourceFromLoadPathOrURL(LoadService.java:754)
at
org.jruby.runtime.load.LoadService.findLibraryWithoutCWD(LoadService.java:631)
at
org.jruby.runtime.load.LoadService.findLibraryWithCWD(LoadService.java:618)
at org.jruby.runtime.load.LoadService.access$200(LoadService.java:122)
at
org.jruby.runtime.load.LoadService$NormalSearcher.trySearch(LoadService.java:388)
at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:265)
at org.jruby.runtime.load.LoadService.require(LoadService.java:282)
at org.jruby.RubyKernel.require(RubyKernel.java:829)
I have the feeling it’s because of my screwy path that has spaces and
a single quote in it. Unfortunately I have no control over this path.
However, this used to work with JRuby 1.1.2 so maybe something else is
going on.
Any ideas why this is happening and how to work around it? Or how to
debug and get some useful info?
It seems strange the working directory in that
IllegalArgumentException an empty path and it’s doing that
findLibraryWithoutCWD() call. I tried printing out java’s
System.getProperty(“user.dir”) before calling bsf.eval() and it is set
to something reasonable. And I have the following system properties
set:
System.setProperty(“jruby.home”, jRubyHome); // the folder containing
jruby.jar
System.setProperty(“jruby.lib”, jRubyLib); // the parent of the folder
containing jruby.jar
System.setProperty(“jruby.script”, “jruby”);
Any ideas?
Adam
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email