ScriptingContainer throws LoadError when there are spaces in the classpath
(Ruby 1.9 mode only)
-----------------------------------------------------------------------------------------------
Key: JRUBY-5343
URL: http://jira.codehaus.org/browse/JRUBY-5343
Project: JRuby
Issue Type: Bug
Components: Ruby 1.9
Affects Versions: JRuby 1.6RC1
Environment: OS X 10.6.6, using jruby-complete-1.6.0.RC1.jar
Reporter: Adam Murray
Assignee: Thomas E Enebo
Attachments: jruby19space.java
I found a regression from JRuby 1.5
If I have spaces in my classpath, when I call ScriptingContainer's
runScriptlet() or put() method in Ruby 1.9 mode, it fails with this error:
Exception in thread "main" org.jruby.exceptions.RaiseException: (LoadError) no
such file to load -- rubygems
at org.jruby.RubyKernel.require19(org/jruby/RubyKernel.java:1050)
at #<Class:0x1016a4a67>.(root)(builtin/gem_prelude.rb:11)
It doesn't happen in Ruby 1.8 mode, or with JRuby 1.5.6. I've only tried this
with the jruby-complete jars.
Attached is a java program that tests for this problem (Sorry it's not a unit
test, wasn't sure how to automate this kind of "environment problem")
Attachment pasted here for reference:
-------------------------------------
import org.jruby.CompatVersion;
import org.jruby.embed.ScriptingContainer;
public class jruby19space {
/* Steps to reproduce
1. mkdir with\ space
cd with\ space
2. copy this file and jruby-complete-1.6.0.RC1.jar to that directory
3. compile
javac -cp jruby-complete-1.6.0.RC1.jar jruby19space.java
4. and run
java -cp .:jruby-complete-1.6.0.RC1.jar jruby19space
(assumes OS X, use ';' instead of ':' on Windows)
*/
public static void main( String[] args ) {
ScriptingContainer container = new ScriptingContainer();
container.setCompatVersion( CompatVersion.RUBY1_9 );
// home directory is something like:
//
../../../with%20spaces/jruby-complete-1.6.0.RC1.jar!/META-INF/jruby.home
System.out.println("home directory: " +
container.getHomeDirectory() );
// Trying to execute any code causes LoadError
container.runScriptlet( "puts 123" );
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
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