Andrew Powell

Into The Mind of A Solutions Architect

Andrew Powell

Harnessing Ruby Within ColdFusion 8

July 22, 2008 · 1 Comment

So I've been getting in to Ruby on Rails a little bit lately. In the course of my investigation into RoR, I took a look at JRuby, which lets you run Ruby scripts from within Java. Well, within ColdFusion, we can access Java objects as well, hence we can also run Ruby scripts from ColdFusion. How do you do this? Well, I've wrapped it up nicely for you into a little CFC called RubyLoader. You can find RubyLoader as a project on my Google Code site.

RubyLoader will read a ruby script, execute it, then give you access to any variables that were returned. You can then access those variables, just like you would any other variables in CFML.

A special word of warning here. This only works with ColdFusion 8 because it requires Java 6 for the included version JRuby to work properly. If you are not running ColdFusion 8, YMMV.

Read more, and download RubyLoader from SVN at my google code site.

Tags: ColdFusion · General · Java · Ruby on Rails · Universal Mind

1 response so far ↓

  • 1 Sean Corfield // Aug 7, 2008 at 1:55 AM

    Andrew, could you comment on how this is different / similar to my scripting.riaforge.org project that supports Ruby via a custom tag inline in CFML?

Leave a Comment