<code>gems</code><ahref="https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Configuration.html">configuration</a> which is provided by plugin, e.g.:</p>
<p>Common methods for <code>JRubyExec</code> for executing a script</p>
</div>
<divclass="ulist">
<ul>
<li>
<p><code>script</code> - <code>Object</code> (Usually File or String). Path to the script.</p>
</li>
<li>
<p><code>scriptArgs</code> - <code>List</code>. List of arguments to pass to script.</p>
</li>
<li>
<p><code>workingDir</code> - <code>Object</code> (Usually File or String). Working directory for script.</p>
</li>
<li>
<p><code>environment</code> - <code>Map</code>. Environment to be set. Do not set <code>GEM_HOME</code> or <code>GEM_PATH</code> with this method.</p>
</li>
<li>
<p><code>standardInput</code> - <code>InputStream</code>. Set an input stream to be read by the script.</p>
</li>
<li>
<p><code>standardOutput</code> - <code>OutputStream</code>. Capture the output of the script.</p>
</li>
<li>
<p><code>errorOutput</code> - <code>OutputStream</code>. Capture the error output of the script.</p>
</li>
<li>
<p><code>ignoreExitValue</code> - <code>Boolean</code>. Ignore the JVm exit value. Exit values are only effective if the exit value of the Ruby script is correctly communicated back to the JVM.</p>
</li>
<li>
<p><code>configuration</code> - <code>String</code>. Configuration to copy gems from. (*)</p>
</li>
<li>
<p><code>classpath</code> - <code>List</code>. Additional Jars/Directories to place on classpath.</p>
</li>
<li>
<p><code>jrubyVersion</code> - <code>String</code>. JRuby version to use if not the same as ```project.jruby.execVersion```.</p>
</li>
<li>
<p><code>gemWorkDir</code> - <code>File</code>. Provide a custom working directory for unpacking GEMs. By default each <code>JRubyExec</code> task
uses it’s own work directory. Use this to set a common work directory for a number of tasks.</p>
<p><code>jvmArgs</code> - <code>List</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:jvmArgs">jvmArgs</a></p>
<p><code>allJvmArgs</code> - <code>List</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:allJvmArgs">allJvmArgs</a></p>
<p><code>systemProperties</code> - <code>Map</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:systemProperties">systemProperties</a></p>
<p><code>bootstrapClassPath</code> - <code>FileCollection</code> or <code>List</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:bootstrapClasspath">bootstrapClasspath</a></p>
<p><code>minHeapSize</code> - <code>String</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html:minHeapSize">minHeapSize</a></p>
<p><code>maxHeapSize</code> - <code>String</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:maxHeapSize">maxHeapSize</a></p>
<p><code>defaultCharacterEncoding</code> - <code>String</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html:defaultCharacterEncoding">defaultCharacterEncoding</a></p>
<p><code>enableAssertions</code> - <code>Boolean</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:enableAssertions">enableAssertions</a></p>
<p><code>debug</code> - <code>Boolean</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:debug">debug</a></p>
<p><code>copyTo</code> - <code>JavaForkOptions</code>. See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html:copyTo">copyTo</a></p>
<p><code>executable</code> - <code>Object</code> (Usually <code>File</code> or <code>String</code>). See <ahref="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:executable">executable</a></p>
<p>The behaviour of <code>project.jrubyexec</code> is slightly different to that of <code>JRubyExec</code>.</p>
</div>
<divclass="ulist">
<ul>
<li>
<p>The version of <code>jruby-complete</code> is strictly tied to the <code>jruby.execVersion</code>. Therefore trying to set <code>jrubyVersion</code>
in the ```jrubyexec``` closure will cause a failure</p>
</li>
<li>
<p>GEMs and additional JARs are only taken from the <code>jrubyExec</code> configuration.</p>
</li>
<li>
<p>It is not possible to supply a <code>configuration</code> parameter to the <code>jrubyexec</code> closure.</p>
</li>
<li>
<p>GEMs will be installed to <code>jruby.gemInstallDir</code>. Existing gems will not be overwritten.</p>
</li>
</ul>
</div>
<divclass="paragraph">
<p>As with <code>JRubyExec</code>, <code>args</code>, <code>setArgs</code> and <code>main</code> are illegal within the <code>jrubyexec</code> closure.
All other methods should work.</p>
</div>
</div>
</div>
<divclass="sect2">
<h3id="running-a-ruby-path-command"><aclass="anchor"href="#running-a-ruby-path-command"></a>Running a Ruby PATH command</h3>
<divclass="paragraph">
<p>Because <code>JRubyExec</code> checks for the existence of the script, it might look at first whether running Ruby commands from
<code>PATH</code> could be difficult. However, this is totally possible by utilising <code>jrubyArgs</code> and passing <code>-S</code> as one would do
when using <code>ruby</code> or <code>jruby</code> on the command-line. Here is an example of running
<h3id="using-a-custom-gem-repository"><aclass="anchor"href="#using-a-custom-gem-repository"></a>Using a custom Gem repository</h3>
<divclass="paragraph">
<p>By default the jruby plugin will use
[rubygems-proxy.torquebox.org](<ahref="http://rubygems-proxy.torquebox.org"class="bare">http://rubygems-proxy.torquebox.org</a>) as its
source of Ruby gems. This is a server operated by the Torquebox project which
presents [rubygems.org](<ahref="https://rubygems.org"class="bare">https://rubygems.org</a>) as a Maven repository.</p>
</div>
<divclass="paragraph">
<p>If you <strong>do not</strong> wish to use this repository, you can run your own Maven
proxy repository for either rubygems.org or your own gem repository by
running the [rubygems-servlets](<ahref="https://github.com/torquebox/rubygems-servlets"class="bare">https://github.com/torquebox/rubygems-servlets</a>)
server.</p>
</div>
<divclass="paragraph">
<p>You can then use that custom Gem repository with:</p>
<h3id="using-the-jruby-gradle-without-gradle"><aclass="anchor"href="#using-the-jruby-gradle-without-gradle"></a>Using the JRuby/Gradle without Gradle</h3>
<divclass="paragraph">
<p>There are still plenty of cases, such as for local development, when you might
not want to create a full <code>.war</code> file to run some tests. In order to use the
same gems and <code>.jar</code> based dependencies, add the following to the entry point
for your application:</p>
</div>
<divclass="listingblock">
<divclass="content">
<preclass="CodeRay highlight nowrap"><codedata-lang="ruby"><spanclass="comment"># Hack our GEM_HOME to make sure that the `rubygems` support can find our</span>
<spanclass="comment"># unpacked gems in build/gems/</span>