Relative Content

Tag Archive for javaspringtomcatrubygemsjruby

Issue with loading JRuby Gems on Tomcat 9

I am using JRuby within a Spring 5 non-Boot application. I use javax.script with JRuby as an implementation to script some parts of my application.
Ruby scripts are located outside the compiled WAR file and are loaded into a ScriptEngine via a path defined in application.properties on my local filesystem. Some scripts may use Ruby Gems which are provided in a jar declared as a Maven dependency. I created this jar using the technique described in this article: http://blog.nicksieger.com/articles/2009/01/10/jruby-1-1-6-gems-in-a-jar/
Gems can be loaded in a Ruby script by simply doing this: