updated hello world

53 views
Skip to first unread message

Jon Egil Strand

unread,
Jan 14, 2011, 3:28:49 PM1/14/11
to monkeybars-mvc
Greetings

First, I must say I really appreciate the goals of this project, and
the effort so far. As a ruby desktop developer with a few production
quality projects under my belt, I've been eager to move to the
robustness of jruby.

However, I'm stumbling into simple setup problems that unfortunately
is getting the best of me. So to get off the ground, does anyone have
an updated hello_world or similar app available?

For reference I've tried both hello world and flickr browser from
website, as well as FlickrBrowser from githup. The latter builds, but
fails to run with this error message:

Exception in thread "main" file:/C:/Users/Jon%20Egil/Documents/
Utvikling/monkeybars/FlickrBrowser/package/jar/lib/java/
flickraw-0.4.4.jar!/flickraw.rb:23:i
n `require': no such file to load -- net/http (LoadError)
from file:/C:/Users/Jon%20Egil/Documents/Utvikling/monkeybars/
FlickrBrowser/package/jar/lib/java/flickraw-0.4.4.jar!/flickraw.rb:23
from file:/C:/Users/Jon%20Egil/Documents/Utvikling/monkeybars/
FlickrBrowser/package/jar/lib/java/flickraw-0.4.4.jar!/flickraw.rb:
1:in `require'


Any help is very appreciated.


Current versions:

java 1.6.0_22
jruby 1.5.6
monkeybars 1.0.6
windows 7


Thanks!

Jon Egil

Adrian Mowat

unread,
Jan 15, 2011, 4:59:25 AM1/15/11
to monkeybars-mvc
Hi Jon,

I just posting a reply and the site did not accept the post!

Please ignore this message. If it is displays correctly, I'll re-pen
my original response.

Adrian

Adrian Mowat

unread,
Jan 15, 2011, 4:51:47 AM1/15/11
to monkeybars-mvc
Hi Jon,

It looks like your jruby configuration is broken. It seems strange
that it's unable to find net/http because that is part of the ruby
standard library so it should be available on the load path by
default.

Can you try requiring net/http in a jrib session as follows...

$ jirb
irb(main):001:0> require 'net/http'
=> true

Assuming that works, can you please add the following at line 21 of
main.rb in the flickr browser project

puts $:.join("\n")

This will dump the load path to stdout

Here's what I get...

$ jruby main.rb
file:/Users/adrian/projects/monkeybars/FlickrBrowser/lib/
monkeybars-0.6.1.jar!
/Users/adrian/bin/jruby/jruby/lib/ruby/site_ruby/1.8
/Users/adrian/bin/jruby/jruby/lib/ruby/site_ruby/shared
/Users/adrian/bin/jruby/jruby/lib/ruby/1.8
.
.
/Users/adrian/projects/monkeybars/FlickrBrowser/src/flickr_browser

FYI: I'm running on OSX as follows...

$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)

$ jruby -v
jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-10 769f847) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_22) [darwin-x86_64-java]

(although this worked fine under jruby 1.5.6)

The monkeybars version comes from the monkeybars jar in the flickr
browser project. In this case monkeybars-0.6.1.jar

Hope this helps

Adrian



On Jan 14, 8:28 pm, Jon Egil Strand <jon.egil.str...@gmail.com> wrote:

Jon Egil Strand

unread,
Jan 15, 2011, 3:58:26 PM1/15/11
to monkeyb...@googlegroups.com


Hi, thanks for your assistance Adrian.

Upgrading to 1.6.0RC1 helped a bit, although a reinstall of 1.5.6 might have yielded similar results. Anyways, after bundling an exe, I run the .jar directly through 

java -jar package\jar\FlickBrowser.jar


FlickrBrowser.jar!/main.class raises an 

java.lang.NoSuchMethodError: org.jruby.ast.executable.AbstractScript.setEncoding(ILjava/lang/String;)V (LoadError)

Anyways, if my problem is rooted in jruby install rather than monkeybars, I'll continue the search there.

Appreciate the feedback.

Jon

--
You received this message because you are subscribed to the Google
Groups "monkeybars-mvc" group.
To post to this group, send email to monkeyb...@googlegroups.com
To unsubscribe from this group, send email to
monkeybars-mv...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/monkeybars-mvc?hl=en

Adrian Mowat

unread,
Jan 16, 2011, 8:39:38 AM1/16/11
to monkeybars-mvc
Hi Jon,

I doubt the version of jruby is the issue. In fact the 1.6 RC is
likely to be less stable than 1.5.6 since it has only just been
released as a beta version.

One question, what happens when you run your app by executing main.rb?

Adrian



On Jan 15, 8:58 pm, Jon Egil Strand <jon.egil.str...@gmail.com> wrote:
> Hi, thanks for your assistance Adrian.
>
> Upgrading to 1.6.0RC1 helped a bit, although a reinstall of 1.5.6 might have
> yielded similar results. Anyways, after bundling an exe, I run the .jar
> directly through
>
> java -jar package\jar\FlickBrowser.jar
>
> *FlickrBrowser.jar!/main.class* raises an
>
> *java.lang.NoSuchMethodError:
> org.jruby.ast.executable.AbstractScript.setEncoding(ILjava/lang/String;)V
> (LoadError)*
>
> Anyways, if my problem is rooted in jruby install rather than monkeybars,
> I'll continue the search there.
>
> Appreciate the feedback.
>
> Jon
>
> > monkeybars-mv...@googlegroups.com<monkeybars-mvc%2Bunsubscribe@go oglegroups.com>

Jon Egil Strand

unread,
Jan 18, 2011, 2:41:01 PM1/18/11
to monkeyb...@googlegroups.com
Hi Adrian

Thank you for your answer. 

I get this:
C:\Users\Jon Egil\Documents\Utvikling\monkeybars\FlickrBrowser\src>jruby main.rb
./resolver.rb:19:in `add_to_classpath': undefined method `<<' for nil:NilClass (NoMethodError)
        from ./manifest.rb:30:in `(root)'
        from org/jruby/RubyKernel.java:1041:in `require'
        from main.rb:6:in `(root)'

same error if I run jruby src\main.rb from the projects root folder.


From you question I understand that the flickrbrowser works out of the box for you?


Thanks
Jon Egil

James Britt

unread,
Jan 19, 2011, 1:12:39 PM1/19/11
to monkeyb...@googlegroups.com
Jon Egil Strand wrote:
> Hi Adrian
>
> Thank you for your answer.
>
> I get this:
> C:\Users\Jon Egil\Documents\Utvikling\monkeybars\FlickrBrowser\src>jruby
> main.rb
> ./resolver.rb:19:in `add_to_classpath': undefined method `<<' for
> nil:NilClass (NoMethodError)
> from ./manifest.rb:30:in `(root)'
> from org/jruby/RubyKernel.java:1041:in `require'
> from main.rb:6:in `(root)'
>
> same error if I run jruby src\main.rb from the projects root folder.
>
>
> From you question I understand that the flickrbrowser works out of the
> box for you?
>

I have a Win7 box, and have been hacking around on Monkeybars trying to
sort out some things, so I will give this a test and see what happens
for me.

I had started checking the example apps that are included with
Monkeybars, with the goal of making sure that whatever is included works
with the current monkeybars, rawr, and JRuby. A lot was broken, though
not in any major way. Mostly it was the outdated build_configuration files.

Some of the examples have been fixed up, but I don't think I even looked
at the Flickr one yet.

OK, so since I have the Win7 box already up, here's what happens when I run
jruby src\main.rb

A window pops up, annoyingly locatated at the top-left of the screen.
(Need to look into centering this. :) )

I type "monkey" into the Search field and click Go. (Need to look into
havong a nice "Please wait ..." modal thing.)


I get nice list of items in the left-hand panel. One says "Downtown
Kyoto, Japan". Really? Monkeys in downtown Kyoto? I click to expand
the node, and click on "Medium".

A very nice picture appears on the right. Sadly, not a single monkey to
be seen. :(

Now on to the real issue.

This runs fine on my Win7 box, and my first thought was that maybe
CLASSPATH is not set (hence the nil thing). But I just tried it on my
Ubuntu box and I get that same error. `add_to_classpath` is a simple
wrapper over $CLASSPATH << stuf.

Ah. Need

require 'java'

in there. So main.rb now has


require 'rbconfig'
require 'java'
require 'manifest'

But now I get an error because the code can't find monkeybars.

The load path is wrong. :(

I need to look at this more. The example is using a mixed set of paths,
loading some things from subdirs, other things from parallel folders,
and even after setting up additonal load path values I keep getting an
error that it can't load the FlickrBrowser classs. It looks like my
$CLASSPATH is getting set OK, but it's not helping.

As to why it works OK for me on Windows but not from Linux, I don't know.


James

Jon Egil Strand

unread,
Jan 19, 2011, 4:50:44 PM1/19/11
to monkeyb...@googlegroups.com
James


Thanks for your effort. At this stage, the flickrbrowser is not the be all or end all, but if you've updated any of the other examples it would be great if you made that available, either on git or through the website.

Thanks again

Jon


--

James Britt

unread,
Jan 20, 2011, 1:01:27 PM1/20/11
to monkeyb...@googlegroups.com
Jon Egil Strand wrote:
> James
>
>
> Thanks for your effort. At this stage, the flickrbrowser is not the be
> all or end all, but if you've updated any of the other examples it would
> be great if you made that available, either on git or through the website.

They're off in a separate branch that I need to merge in. I've been
getting distracted with work. :)


James


Reply all
Reply to author
Forward
0 new messages