JRubyをインストールしても動作しなかったので諦めかけた。けどruby-processingのページに行ってみたら、JRubyが必要だとはどこにも書いてなかった。
All that you need to get Ruby-Processing going is Ruby (1.8 or 1.9) and Java (1.5 or 1.6) ― and your machine probably came with both of those baked-in.
Getting Started · jashkenas/ruby-processing Wiki · GitHub
じゃあ、通常のRubyでもいけるんじゃ?ってわけでgemでサーチかけてみたらありました!
gem search ruby-processing --remote Bulk updating Gem source index for: http://gems.rubyforge.org/ ruby-processing (1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1)
となれば、インストールは簡単です。
sudo gem install ruby-processing --remote Successfully installed ruby-processing-1.0.8
動作確認。
rp5 --help Ruby-Processing is a little shim between Processing and JRuby that helps you create sketches of code art. Usage: rp5 [run | watch | live | create | app | applet | unpack] path/to/sketch Examples: rp5 unpack samples rp5 run samples/jwishy.rb rp5 create some_new_sketch --bare 640 480 rp5 watch some_new_sketch.rb rp5 applet some_new_sketch.rb Everything Else: http://wiki.github.com/jashkenas/ruby-processing
なんか、Windowsにインストールしたときに比べて、コマンドが増えた?
サンプルを動作させてみました。
rp5 unpack samples rp5 run samples/jwishy.rb
動作結果。
いつの間にか、GUIなコントローラまで使えるようになっていたんですね。
ついでに、これまでWindows+JRuby+ruby-processingで作っていたのも動作させてみる。
ちゃんと動く。完璧じゃん。JRuby上でのみ動くと思ってたんだけどな。古い情報だったのか?
そのうち何か作ってみようと思います。
関連:WindowsにProcessing+JRuby+ruby-processingをインストールした - hellkite 日記と雑記とメモ。