简体   繁体   中英

Setting classpath for org.jruby.Main?

I'm running JRuby as such:

Main jrubyRunner = new Main()
jrubyRunner.main(sassCompileCommandLineArgs)

I have some gems I've compiled into jars. How do I include those jars on the classpath that jrubyRunner will use?

private static def setupCompassInvocationArgs =
['-e', "require 'rubygems';gem 'compass'; load Gem.bin_path('compass', 'compass')"]

protected def runCompassCommand(def compassArgs) {
    Main main = new Main()
    main.run([setupCompassInvocationArgs, compassArgs].flatten() as String[])
}

The first bit is what you need to load various gems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM