0

我是新脚本用户。

有没有使用 jruby 作为脚本语言的示例或教程?

谢谢并恭祝安康,

马尼什

==根据ejboy的建议更新==

  • 在 lib 中复制 jruby.jar (1.7.4)。
  • 然而 scriptella 失败了,但有以下异常。

2013 年 6 月 14 日上午 9:31:36 脚本 /bigdisk/work/cougar/code/leopard-monitor/analytics/kpoint_usage/scriptella/scripts/jruby_sample.xml 执行失败。

/etl/script[1] failed: keySet
Location: /etl/script[1]
Jun 14, 2013 9:31:36 AM <SEVERE> Scriptella bug report. Submit to issue tracker.
Scriptella version: 1.1
Exception:
scriptella.execution.EtlExecutorException: /etl/script[1] failed: keySet Location: /etl/script[1]
    at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:190)
    at scriptella.tools.launcher.EtlLauncher.execute(EtlLauncher.java:276)
    at scriptella.tools.launcher.EtlLauncher.launch(EtlLauncher.java:193)
    at scriptella.tools.launcher.EtlLauncher.main(EtlLauncher.java:321)
Caused by: scriptella.core.ExceptionInterceptor$ExecutionException: /etl/script[1] failed: keySet
    at scriptella.core.ExceptionInterceptor.execute(ExceptionInterceptor.java:44)
    at scriptella.core.Session.execute(Session.java:103)
    at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:227)
    at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:183)
    ... 3 more

以下是我的 xml 文件。

<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
  <description>
    use jruby as scripting language.
  </description>
  <connection id="script-jruby" driver="script" url="out/test-out.csv"> <!-- classpath="path/to/jar:path/to/jar2"> -->
     language=jruby
  </connection>
  <script connection-id="script-jruby">
    puts "Hello world - using jruby"
  </script>
</etl>
4

1 回答 1

0

尝试将语言属性设置为 jruby 并确保所需的 jar 在类路径中可用。您可以将它们复制到<scriptella_home>/lib目录或包含在连接声明中:

<connection id="script" driver="script" classpath="path/to/jar:path/to/jar2">
   language=jruby
</connection>
于 2013-06-13T12:25:41.813 回答