Monkeybars does not work out of the box

55 views
Skip to first unread message

F. Timur Senguen

unread,
May 16, 2013, 9:40:29 AM5/16/13
to monkeyb...@googlegroups.com
Hi,

I'm trying to get into JRuby GUI coding and thought Monkeybars was the ideal way of getting around much of Swing pain. Unfortunately it seems that the current version of Monkeybars (1.3.0) has some issues that prevent me from using it. 

Here is what I did:

Installed latest JRuby via RVM (1.7.3), latest monkeybars and rawr (through gems.neurogami.com).
Created a new monkeybars project (jruby -S monkeybars test, cd test, jruby -S rawr install, jruby -S rake generate ALL=src/test)

The problem:
main.rb has a problem from the get go. When running jruby -S src/main.rb, this error pops up:
SyntaxError: src/main.rb:20: syntax error, unexpected tCONSTANT
$LOAD_PATH << File.expand_path File.dirname(__FILE__)
I figured out since that there is a missing set of parentheses. But once I change that and rerun the main.rb, the following error pops up:

NameError: cannot load Java class foxtrot.Worker
         for_name at org/jruby/javasupport/JavaClass.java:1227
  get_proxy_class at org/jruby/javasupport/JavaUtilities.java:34
      java_import at file:/Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/jruby.jar!/jruby/java/core_ext/object.rb:26
              map at org/jruby/RubyArray.java:2361
      java_import at file:/Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/jruby.jar!/jruby/java/core_ext/object.rb:22
           (root) at /Users/tsenguen/.rvm/gems/jruby-1.7.3/gems/monkeybars-1.3.0/lib/monkeybars/task_processor.rb:1
          require at org/jruby/RubyKernel.java:1027
           (root) at /Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:1
          require at /Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:55
          require at org/jruby/RubyKernel.java:1027
           (root) at /Users/tsenguen/.rvm/gems/jruby-1.7.3/gems/monkeybars-1.3.0/lib/monkeybars/view.rb:8
           (root) at /Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:1
          require at org/jruby/RubyKernel.java:1027
          require at /Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:55
           (root) at /Users/tsenguen/.rvm/gems/jruby-1.7.3/gems/monkeybars-1.3.0/lib/monkeybars/controller.rb:4
          require at org/jruby/RubyKernel.java:1027
           (root) at /Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:1
          require at /Users/tsenguen/.rvm/rubies/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:55
          require at org/jruby/RubyKernel.java:1027
           (root) at /Users/tsenguen/.rvm/gems/jruby-1.7.3/gems/monkeybars-1.3.0/lib/monkeybars.rb:4
           (root) at src/main.rb:21


 This is where I am stuck. Interestingly, when I download the HelloWorld example from your tutorials section, it runs perfectly when I call it the same way (jruby -S src/main.rb).

Any help or suggestions you might be able to offer would be greatly appreciated.

James Britt

unread,
May 16, 2013, 1:14:05 PM5/16/13
to monkeyb...@googlegroups.com
F. Timur Senguen wrote:
>
> The problem:
> main.rb has a problem from the get go. When running jruby -S
> src/main.rb, this error pops up:
>
> SyntaxError: src/main.rb:20: syntax error, unexpected tCONSTANT
> $LOAD_PATH << File.expand_path File.dirname(__FILE__)
>
> I figured out since that there is a missing set of parentheses. But once
> I change that and rerun the main.rb, the following error pops up:

Let me take a look at that. That first bug as me being a bit hasty in
removing needless parens. The second bug I've sen before but I don not
recall what causes it so I have to poke around. I think it's related to
the path.



James

--

jamesbritt.com - Live curious
justthebestparts.com - Feed your head
neurogami.com - Hack your world

James Britt

unread,
May 16, 2013, 5:00:21 PM5/16/13
to monkeyb...@googlegroups.com
There were issue in locating files that were in a jar (in particular
foxtrot.Worker, which is inside the Monkeybars jar).

I updated Monkeybars and also had to update Swingset-NG (it had bad code
for detecting if it was being called from inside a jar).

I pushed the code to github; I'm in the process of uploading the gems now.

F. Timur Senguen

unread,
May 17, 2013, 2:59:12 PM5/17/13
to monkeyb...@googlegroups.com
Wow, awesome, thanks for the quick response.

I will try again.

F. Timur Senguen

unread,
May 17, 2013, 4:08:15 PM5/17/13
to monkeyb...@googlegroups.com
Working perfectly now. Looking forward to doing some GUI coding!
Reply all
Reply to author
Forward
0 new messages