-------- Original-Nachricht --------
> Datum: Thu, 21 Aug 2008 01:46:28 +0900
> Von: Mark Thomas <ruby / thomaszone.com>
> An: ruby-talk / ruby-lang.org
> Betreff: Re: Jruby and gems

> 
> > jruby <scriptname>
> 
> And to install the gem, did you type
> /opt/jruby/bin/gem install profligacy
> ?

Dear Nick, Logan, Charles and Mark,

thank you for your responses.

Charles:
>And you can certainly stop by #jruby as well for assistance getting the
>gems working. My guess is that this may be a problem with how JRuby is
>installed.
>
>- Charlie


I re-installed jruby from source, untarring file  jruby-1.1.3.tar.gz with ant (as done previously).
These are some of my data (all on Ubuntu 8.04):

axel@alecrim:~$ java -version
java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK Server VM (build 1.6.0_0-b11, mixed mode)
axel@alecrim:~$ jruby -version
jruby 1.1.3 (ruby 1.8.6 patchlevel 114) (2008-08-20 rev 6586) [i386-java]
-e:1: undefined local variable or method `rsion' for main:Object (NameError)
axel@alecrim:~$ jruby --version
jruby 1.1.3 (ruby 1.8.6 patchlevel 114) (2008-08-20 rev 6586) [i386-java]

Logan:

>Axel,
>Ruby's gems and JRuby's gems are normally not in the same location. 

That's why I wouldn't want to mess with gem path variables without asking :)

>I believe JRuby uses jgem now. If not, you can symlink your gem script
>to jgem. Make sure that profligacy is installed with jgem install
>profligacy (or whatever the name of the gem is). It's common for
>myself and those at the office to mix this up and we've had a few of
>the Monkeybars users experience the same issue.

Mark:


I had used some other command the author of the gem gave me. I went
to the jruby directory, and used the "gem install" command from there.
It is not an /opt/jruby etc. directory, as I don't have one, but it is a jruby
command rather than an MRI one.

Now I tried installing with jgem also:
Now, if I go to the the directory where jgem is, it gives me this error:

root@alecrim:/usr/local/jruby-1.1.3/bin# ./jgem /usr/local/profligacy*gem
/usr/bin/env: jruby: No such file or directory

Otherwise, calling jruby works ....

axel@alecrim:~$ jruby j.rb
value: Bar
value: baz
value: foo
axel@alecrim:~$ cat j.rb
require 'java'
include_class 'java.util.TreeSet'
set = TreeSet.new
set.add "foo"
set.add "Bar"
set.add "baz"
set.each do |v|
  puts "value: #{v}"
end

I'll definitely also have a look at Monkeybars, but that software will have to find java's swing also...
so I'd like to be able to use this gem here....

Thank you for your help!

Best regards,

Axel


-- 
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine f Alle: http://www.gmx.net/de/go/messenger03