[NOTE: This info is out of date. You should check out the Embedding Ruby in Java page on the official JRuby wiki. It's now recommended you use the "core" (built in) embedding API instead of BSF as explained below.]
This article describes how to setup Eclipse to develop Java+Ruby applications using JRuby, a Java wrapper for Ruby that can be embedded anywhere Java runs (which is just about everywhere!). I am use this setup to develop the MaxObject "ruby" for running Ruby inside of Max/MSP.If you do not already have Eclipse setup, see these instructions (if you don't have Max/MSP stop after step 4 of those instructions)
Although this article describes the setup in Eclipse, the steps should be easily adapted to other IDEs. Note the Ruby Developer Tools plugin is specifically for Eclipse. Hopefully your IDE already has Ruby support, otherwise why not use Eclipse?
When I say "right click", OS X users should understand this is the same as ctrl+click.
. You should see this in your console:
hello from a string of ruby code
hello from a file
hello System.out
http://ruby-lang.org is a great resource for learning Ruby. The Ruby Cheatsheet is a nice quick reference.
The JRuby distribution has samples and docs if you want to know more about JRuby.
JRuby runs on the Bean Scripting Framework (BSF), which also supports things like Python, Groovy, and even scripted Java (BeanShell). Python is supported "out of the box", so you already have everything you need to run Python inside Java and Java-based Max externals. Check out the BSF website for more info. The BSF download comes with the API documentation, which is useful for working with JRuby.
For running Ruby inside Max/MSP, try my ajm.ruby max object. Source code is included so you can see how I dealt with the "glue" between Max and Ruby.