We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpProcessing Implementations › Can't get ruby-processing working on Windows
Page Index Toggle Pages: 1
Can't get ruby-processing working on Windows (Read 3506 times)
Can't get ruby-processing working on Windows
Apr 12th, 2009, 7:34pm
 
I'm on Windows XP. Today I installed ruby-processing by running "gem install ruby-processing" per the instructions on the jashkenas/ruby-processing/getting-started page on wiki.github.com.

I ran "rp5 unpack samples" successfully, but now when I try to run "rp5 run samples/jwishy.rb" I get:

Exception in thread "main" java.lang.NoClassDefFoundError: Files/ruby/lib/ruby/gems/1/8/gems/ruby-processing-1/0/6/lib/core/jruby-complete/
jar

This looks to me like a symptom of something being unable to handle the space in file paths like "C\:Program Files\ruby\blah\blah\blah".

What's broken and how do I fix it?

(I hope this is the right place to ask this question. If not, please point me to a better place.)

Thanks.

Eva
Re: Can't get ruby-processing working on Windows
Reply #1 - Apr 13th, 2009, 4:47pm
 
Hey Eva.

This is very much the right place to ask. I just tried installing the gem on Windows XP, and running several of the samples, and they all worked just fine.

Those error messages, however, look suspicious, with the periods replaced by slashes... What version of Java are you using? And is there a particular class that the NoClassDefFoundError says it can't find?

-- Jeremy
Re: Can't get ruby-processing working on Windows
Reply #2 - Apr 13th, 2009, 10:40pm
 
> What version of Java are you using?

I don't know that much about Java, so I'm not sure how to find the answer to this question. There seem to be two versions in my machine's c:\program files\java path, in folders named jre6 and jre1.6.0_04. How do I find out which one, if any, ruby-processing is using?

> And is there a particular class that the NoClassDefFoundError says it can't find?

Here's the entire output from "rp5 run samples/jwishy.rb":

Exception in thread "main" java.lang.NoClassDefFoundError: Files/ruby/lib/ruby/gems/1/8/gems/ruby-processing-1/0/6/lib/core/jruby-
complete/jar
Caused by: java.lang.ClassNotFoundException: Files.ruby.lib.ruby.gems.1.8.gems.ruby-processing-1.0.6.lib.core.jruby-complete.
jar
       at java.net.URLClassLoader$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: Files/ruby/lib/ruby/gems/1.8/gems/ruby-processing-1.0.6/lib/core/jruby-complete.
jar.  Program will
exit.

Re: Can't get ruby-processing working on Windows
Reply #3 - Apr 14th, 2009, 7:44pm
 
That's interesting. I'm also (successfully) using Java 1.6.0 on Windows.

It looks like your install can't even find the main class, which means that something screwy is going on with your jruby-complete.jar. org.jruby.Main is an out-of-the-box JRuby class, and isn't Ruby-Processing specific.

If haven't given up hope yet, try downloading the source from the following link:

http://github.com/jashkenas/ruby-processing/zipball/master

Unzip it, cd into the folder, and try this:

Code:
ruby bin/rp5 run samples/jwishy.rb 



I'd be interested to know if that works out for you.
Re: Can't get ruby-processing working on Windows
Reply #4 - Apr 14th, 2009, 10:31pm
 
The start-up using your file tree was successful, thanks.
I poked around in the code and found that runner.rb contains:
Code:

runner = "#{RP5_ROOT}/lib/ruby-processing/runners/#{starter_script}"
java_args = discover_java_args(sketch)
command = "java #{java_args} -cp #{jruby_complete} #{dock_icon} org.jruby.Main #{runner} #{sketch}"
exec(command)

When I run my gem-installed version, the value of 'command'
at the point of exec() invocation is:

java -cp C:/Program Files/ruby/lib/ruby/gems/1.8/gems/ruby-processing-1.0.6/lib/core/jruby-complete.
jar  org.jruby.Main C:/Program Files/ruby/lib/ruby/gems/1.8/gems/ruby-processing-1.0.6/lib/ruby-processing/runn
ers/run.rb samples/jwishy.rb"

So there's the problem. The 'java' executable is being passed
"C:/Program" and "Files/ruby/etc" as two separate arguments.

The reason it works when I use your file tree is because
I unzipped it into a path that had no spaces in the name.
Re: Can't get ruby-processing working on Windows
Reply #5 - Apr 22nd, 2009, 6:47pm
 
Hi Eva. Ruby-Processing 1.0.7 is out, and with it a bunch of platform-specific fixes, including one that (I hope) solves your space problem -- I still haven't been able to reproduce it on my end. If you don't mind, give 1.0.7 a spin, and see if that does it for you.
Page Index Toggle Pages: 1