Skip to content
Martin Prout edited this page May 13, 2014 · 58 revisions

Read platform requirements here. New Mac users (OSX 9+) should follow this step by step installation guide.

Before you start you might wish to install jruby on your system see jruby site, you will also need to install vanilla processing preferably processing-2.2, although other versions may also work). You will also need to set your PROCESSING_ROOT in your .rp5rc configuration file, this is easiest done by running the SetProcessingRoot.pde (see this gist) sketch from the vanilla processing ide.

gem install ruby-processing
install_jruby_complete   # uses wget to download and install jruby-complete-1.7.11.jar
rp5 unpack samples
rp5 run samples/contributed/jwishy.rb

Or if not using an installed jruby

rp5 unpack samples
rp5 --nojruby run samples/contributed/jwishy.rb

And voilà.

jwishy

See also examples from the Learning Processing book, check out Learning Processing with Ruby, and download the examples (note many of the sketches will need updating for processing-2.0, and the latest ruby-processing).

Making Your Own

Since the latest release bare sketches are preferred, although class wrapped sketches are still supported. Because every sketch has a setup method, called once at the start, and a draw method, called continuously as it animates; Ruby-Processing includes a sketch creator to get you started on the right foot with the proper (minimal) boilerplate. Using rp5 create my_sketch 800 600, will generate a Processing::App that's 800 by 600 pixels in size, and just displays a blank window.

def setup
  size 800, 600  
end
  
def draw 

end

P3D sketches

rp5 create my_sketch --p3d 800 600

def setup
  size 800, 600, P3D  
end
  
def draw 

end

Windows caveats

See also

For Windows Users

You may not have wget installed, if so you can download the jar into the vendors folder, before running 'install_jruby_complete`

Gem install didn't seem to create environment variable RP5_ROOT upon which ruby-processing depends. Adding this environment variable to the path of the gem seemed to do the trick. If you're getting some errors where you don't know what's going on this might be the issue. For permanent solution amend your .rp5rc configuration file.