Issue Type: Bug Bug
Affects Versions: JRuby 1.6.7
Assignee: Thomas E Enebo
Created: 05/Sep/12 8:28 AM
Description:

I don't get the load path set up correctly when I embed JRuby. The code below is the smallest piece that shows the problem.

public class EmbedSpike {
    public static void main(String[] args) throws Exception {
        RubyInstanceConfig config = new RubyInstanceConfig();
        config.setCompatVersion(CompatVersion.RUBY1_9);
        Ruby runtime = Ruby.newInstance(config);
        runtime.evalScriptlet("$LOAD_PATH.each { |path| puts path };");
    }
}

When run I get this output:

file:/averylongpath/lib/embed_spike.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.9
file:/averylongpath/lib/embed_spike.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared
file:/averylongpath/lib/embed_spike.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8
file:/averylongpath/lib/embed_spike.jar!/META-INF/jruby.home/lib/ruby/1.9

Notice that site_ruby/1.9 and site_ruby/1.8 are both included.

I've run the code as JRUBY_OPTS='' java -jar lib/embed_spike.jar. The JAR contains the EmbedSpike class merged into jruby-complete.jar (v1.6.7).

If I remove the line with setCompatVersion the load path is correct and includes only 1.8.

Project: JRuby
Priority: Major Major
Reporter: Theo Hultberg
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to