Can't get it going on mac

I’m on OS X 10.5.3. I just downloaded 1.1.3 and unzipped it. Went to
the
jruby/bin dir. made everything executable.

When I run jruby I get:

zeppelin:bin pswenson$ jruby
Exception in thread “main” java.lang.NoClassDefFoundError:
org/jruby/Main

argh

any ideas?

sorry, 1.1.2.

On Sat, Jun 21, 2008 at 6:31 PM, phil swenson [email protected]

On Jun 21, 2008, at 7:36 PM, phil swenson wrote:

Exception in thread “main” java.lang.NoClassDefFoundError: org/jruby/
Main

argh

any ideas?

I guess you downloaded the source package, and not the binary. You
could run ‘ant’ in the ‘jruby-1.1.2’ directory, or you could download
the binary package:
http://dist.codehaus.org/jruby/jruby-bin-1.1.2.tar.gz

Hiro

I downloaded the bin

On Jun 21, 2008, at 7:21 PM, Hirotsugu A. [email protected]

On Jun 21, 2008, at 9:05 PM, Phil S. wrote:

I downloaded the bin

May I urge you to double check? The message suggests that JVM is not
finding the org.jruby.Main class, which should reside in $CLASSPATH
set up by the ‘jruby’ script.

Perhaps you have $PATH set up incorrectly, and ‘jruby’ is pointing to
something else. What does ‘which jruby’ give you?

Hiro


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

ah, interesting… I get the noclassdeffounderror when I’m in bin.
However
when I’m not in bin and type jirb it works. Must have a weird pathing
problem. bin is in the path btw
I also have “.” in the path, but I can’t imagine that hurts anything.
btw,
“which jruby” points at the correct jruby.

output below:

zeppelin:bin pswenson$ pwd
/Users/pswenson/Downloads/jruby-1.1.2/bin
zeppelin:bin pswenson$ jirb
Exception in thread “main” java.lang.NoClassDefFoundError:
org/jruby/Main
zeppelin:bin pswenson$ which jirb
./jirb
zeppelin:bin pswenson$ cd …
zeppelin:jruby-1.1.2 pswenson$ jirb
irb(main):001:0> exit

On Sat, Jun 21, 2008 at 8:33 PM, Hirotsugu A. [email protected]

On Jun 22, 2008, at 9:48 AM, phil swenson wrote:

zeppelin:bin pswenson$ jirb
Exception in thread “main” java.lang.NoClassDefFoundError: org/jruby/
Main
zeppelin:bin pswenson$ which jirb
./jirb
zeppelin:bin pswenson$ cd …
zeppelin:jruby-1.1.2 pswenson$ jirb
irb(main):001:0> exit

Well, the problem is indeed the ‘.’ in your $PATH. When you invoke
‘jruby’ from ‘.’, JRUBY_HOME gets set to ‘.’, which leads to CP (class
path) getting set to ‘./lib/*.jar’, which doesn’t exist in the ‘bin’
directory.

I’m guessing that if $JRUBY_HOME ends up being ‘.’ before setting CP,
JRUBY_HOME should be set to ‘…’.

The following patch will work, but I don’t know if it’s the best
solution to this problem.

$ svn diff jruby
Index: jruby

— jruby (revision 7011)
+++ jruby (working copy)
@@ -36,6 +36,9 @@

JRUBY_HOME_1=dirname "$PRG" # the ./bin dir
JRUBY_HOME=dirname "$JRUBY_HOME_1" # the . dir
+if [ $JRUBY_HOME = ‘.’ ] ; then

  • JRUBY_HOME=’…’
    +fi

if [ -z “$JRUBY_OPTS” ] ; then
JRUBY_OPTS=""

In the meantime, I suggest you remove ‘.’ from your path. Potentially
changing the executable depending on $PWD is not a good idea, IMHO.
(This is a reason that root’s PATH doesn’t contain ‘.’.)

Hiro


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email