ARGV not defined when running ruby scripts via BSF
--------------------------------------------------

                 Key: JRUBY-1111
                 URL: http://jira.codehaus.org/browse/JRUBY-1111
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.0.0RC3
            Reporter: Raymond Barlow


If you attempt to run any ruby code that uses the ARGV variable, you get the 
following error (or similar):
Exception: /usr/lib/jruby/lib/ruby/1.8/optparse.rb:1721: uninitialized constant 
ARGV (NameError)

Here is some sample code to reproduce the error:

import org.apache.bsf.BSFManager;

public class Test {
  
  public static void main(String[] args) {
    runRuby("puts ARGV");
  }
  
  public static void runRuby(String code) {
    BSFManager.registerScriptingEngine("ruby", 
"org.jruby.javasupport.bsf.JRubyEngine", new String[] { "rb" });
    BSFManager manager = new BSFManager();
    
    try {
      manager.eval("ruby", "(java)", -1, -1, code);    
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  
}

-- 
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

Reply via email to