Install JRuby GreasySpoon package

Since version 1.0.x, language extensions are pre-packaged in order to easier installation. To install Ruby package:
 
» download Ruby package for GreasySpoon here
 
» copy the package in {$gs}/pkg/ directory
 
» Install it using either the web interface (Maintenance>>Scripting>>Language packs) or the greasyspoon -e (unix) or greasyspoon.bat (windows) shell command.
 
Note: These functions require GreasySpon to run with admin (root) privileges and there are known limitations regarding packages installation/removal.
 
» To install new ruby libs, use gem command. For example, to install hpricot, use following command:
jruby -S gem install hpricot --version '~>0.6.1'


Manual installation of JRuby engine

In case of issues with packaged version of JRuby, here is a quick guide to install it manually.

JRuby manual installation steps
» download latest jsr-223 libraries from scripting.dev.java.net
» uncompress it and copy jruby/build/jruby-engine.jar into your Java $jre/lib/ext directory
» download JRuby from jruby.codehaus.org
» uncompress it to $greasyspoon/lib/ directory so you have something like
$greasyspoon/lib/jruby-1.1.5/{bin|lib|share|...}
» copy $greasyspoon/lib/jruby-1.1.5/lib/jruby.jar into your Java $jre/lib/ext directory
» if not done, add jruby and java bin path to your environment ($PATH, %PATH%,... ):
PATH=$PATH:$greasyspoon/lib/jruby-1.1.5/bin/:$jre/bin
» check that jruby is correctly installed using "jruby -v"
 
Configure GreasySpoon to find ruby libs
» Edit $greasyspoon/conf/greasyspoon.ini
» Update or create following line in configuration:
path=conf;serverscripts;lib/jruby-1.1.5/lib/ruby/1.8;
» Start/restart GreasySpoon and check that "JRuby Engine - language: ruby - version: 1.8.6" is listed in available Languages on administration interface
 
Notes
» To add ruby libs through gem, use gem command. For example, to install hpricot, use following command:
jruby -S gem install hpricot --version '~>0.6.1'
» If some libs are not founded using gem, force path in $greasyspoon/conf/greasyspoon.ini accordingly, for example:
path=conf;serverscripts;lib/jruby-1.1.5/lib/ruby/1.8; \
lib/jruby-1.1.5/lib/ruby/gems/1.8/gems/hpricot-0.6-jruby/lib; \
lib/jruby-1.1.5/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib; \
lib/jruby-1.1.5/lib/ruby/gems/1.8/gems/htmlentities-4.0.0/lib
» Hpricot has different entries in it's lib directory (fast_xs.so and hpricot_scan.so) than the version used by jruby (universal-java1.6/fast_xs.jar and universal-java1.6/hpricot_scan.jar). In case of problem with Hpricot, simply copy the 2 hpricot libraries one directory level up