jashkenas / ruby-processing

Code as Art, Art as Code. Processing and Ruby are meant for each other.
http://github.com/jashkenas/ruby-processing/wikis
Other
1.28k stars 94 forks source link

PApplet not found when trying to run ruby script. #127

Closed rubsnick closed 8 years ago

rubsnick commented 8 years ago

I'm currently using this guide I'm running into the issue with Papplet not found. Specifically it states NameError: PApplet not found in packages processing.core; last error: cannot load Java class processing.core.PApplet const_missing at file:/Users/myuser/.rvm/rubies/jruby-1.7.19/lib/jruby.jar!/jruby/java/core_ext/module.rb:42

I've also seen this related issue but their solution is currently not working for me. I'm unsure what else might be wrong.

Also my Java version is the following.

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

When I run rp5 setup check it responds back with

Ruby-Processing version 2.7.0
  PROCESSING_ROOT = /Applications/Processing.app/Contents/Resources/Java
  jruby-complete installed = true

I'm unsure how else to run this script. it's literally the only thing missing for me to be able to finish my arduino project sadly. I'd appreciate any help. Oh and the Processing version I'm using is the 2.2.1 version. I've also tried running all these commands using Sudo and that's not helping. I'm running OSX El Capitan and my JDK is 8.

monkstone commented 8 years ago

It looks like a path issue, are you sure the PROCESSING_ROOT in your config matches your setup? On Archlinux I have:-

PROCESSING_ROOT: '/home/tux/processing-2.2.1'
sketchbook_path: '/home/tux/sketchbook'
# Windows other linux distros who knows

JRUBY: 'true'

where ls processing-2.2.1 =

core  launch4j  modes       processing-java  tools
java  lib       processing  revisions.txt

for you that would be:-

ls /Applications/Processing.app/Contents/Resources/Java
monkstone commented 8 years ago

PS: for your application you literally probably only need the core.jar if you can get it working you might be able to rp5 app yaw.rb to export app (works well with simple apps, may need a bit of work to get it to work with the visualizer, but you'd have something that was a lot more portable).

rubsnick commented 8 years ago

Thank you, it turns out my Path was /Applications/Processing.app/Contents/Java not resources. Very strange but showing the me contents of the ls really helped solve this. Thank you.