Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Code as Art, Art as Code. Processing and Ruby are meant for each other.
Ruby Java HTML


Gem Version

Is a ruby wrapper around the Processing code art framework, built using JRuby.

Processing provides a tidy API, with a bunch of handy methods you can call from Ruby-Processing. Here's a smattering:

alpha, arc, background, blend, blue, ellipse, frame_rate, hue, lerp, load_image, load_pixels, mouse_pressed, noise, rect, saturation, shape, smooth, text_align, translate, triangle, vertex...


We assume you have some version of ruby installed if not, there is a guide to installing ruby on various platforms including windows. Or here is an alternative install guide.

MacOSX users please try out this new method or see this japanese guide.

Ideally you should install jruby, at the very least you will have at least ruby-1.9.3 installed. You should download and install vanilla processing-2.2.1 prior to installing this version of ruby-processing. You must also set the PROCESSING_ROOT in the .rp5rc yaml configuration file, the easiest way to do this is by running the SetProcessingRoot.pde sketch in the processing ide.

Then install ruby-processing (from rubygems-org) in the usual way

gem install ruby-processing some systems eg Ubuntu may require sudo access

To install jruby-complete use our built in tool (relies on wget to download jruby-complete-1.7.20)

since ruby-processing-2.5.0 rp5 setup install (was install_jruby_complete)

If you haven't got wget just download jruby-complete-1.7.20 (for ruby-processing-2.6.10)to the vendors folder (then run above tool)

The vendored jruby-complete is only required for application export, and running certain sketches (eg shader sketches see wiki).

How to build latest development version

See wiki

For previous release (version 2.6.9) checkout the "stable" branch and follow the same instructions


See Wiki

See also FAQs, Contributing and Samples

Usage Example

rp5 run my_sketch.rb 

or if not using system jruby (and not JRUBY: 'false' in ~/.rp5rc)

rp5 --nojruby run my_sketch.rb

where a simple my_sketch.rb could look like this

def setup
  size 400, 400  
  fill 255

def draw
  background 0
  ellipse mouse_x, mouse_y, 100, 100

or a simple 3D sketch cube.rb features ArcBall from vecmath library

load_library :vecmath

# Use mouse drag to rotate
# the arcball. Use mousewheel
# to zoom. Hold down x, y, z
# to constrain rotation axis.

def setup
  size(600, 600, P3D)
  ArcBall.init(self, 300, 300)
  fill 180

def draw
  box(300, 300, 300)

See samples for many more examples

Supported java version

NB: you can't use jdk/jre installed by processing

  • Open jdk8 (latest version preferred, is the default linux install)
  • jdk7 from Oracle (latest version preferred, or required by Mac)
  • jdk8 from Oracle (latest version preferred, or required by Mac)

Supported ruby version

This gem has been tested with the following ruby implementations

  • Ruby 1.9.3
  • Ruby 2.0.0
  • Ruby 2.1.2
  • Ruby 2.2.1
  • JRuby preferred (required to use rubygems in sketches)

NB: current support for ruby-2.0 syntax is limited (and experimental see jruby documentation). However if you use JRuby- you will find ruby-2.2 syntax is now supported (try jruby-9000-pre branch). Future development of ruby-processing will target ruby-2.2 (with probable backward compatibitility with MRI ruby-2.1) any further backward compability will be accidental and unsupported (owing to limited resources).

Supported processing version

  • processing-2.2.1 (recommended)
  • seems also work with processing-3.0a5 (might be worth upgrading to, a more recent jogl etc....)
  • Not supported any later version (currently best avoided, owing to severe period of transition LWJGL now ditched in favour of JOGL may herald stability)

Ruby alternatives for processing convenience methods

Many processing (convenience) methods make little sense in ruby (and many are no-longer implemented). See ruby alternatives for details.


Something went wrong with that request. Please try again.