I downloaded the BIN of JRuby 1.1.4 (jruby-bin-1.1.4.tar.gz) and
unzipped it into a directory under my home directory
(/User//jruby-1.1.4).
I have made sure that JRUBY_HOME points to /Users/me/jruby-1.1.4 and
that JAVA_HOME points to the Java 1.5.xx implementation on my machine.
When I then go to the bin folder in JRuby and type “./jruby” I get the
following:
Exception in thread “main” java.lang.NoClassDefFoundError:
org/jruby/Main
Having switched from a Win machine not too long ago it seems harder to
get JRuby running on my Mac. Any idea what I did wrong?
Having switched from a Win machine not too long ago it seems harder
to get JRuby running on my Mac. Any idea what I did wrong?
This should be a FAQ.
When you invoke ./jruby from within the bin directory, the script
resets JRUBY_HOME so when it goes looking for its jars it cannot find
them. Also, it is likely you have ‘.’ in your $PATH which is incorrect
(remove it).
Make sure that $JRUBY_HOME/bin is in your $PATH. Change your current
working directory to anything other than JRUBY_HOME/bin and it will
work (just “cd” to somewhere else). This has been discussed before on
this list so feel free to search the archives if this still doesn’t
fix your problem.
When you invoke ./jruby from within the bin directory, the script resets
JRUBY_HOME so when it goes looking for its jars it cannot find them.
Also, it is likely you have ‘.’ in your $PATH which is incorrect (remove
it).
Pretty sure Chuck has hit the nail on the head. There’s actually an open
bug for this, and it’s almost entirely an issue contained within the
jruby bash script. Put the bin dir in PATH and run jruby as normal.
Removing . is optional, but recommended in general (google for reasons
why).
This may be a result of using Java5 instead of Java6. Java6 was in a
recent
update, but if you don’t explicitly set it on OSX it won’t get used.
Here
are some good instructions for doing that: http://lists.apple.com/archives/Java-dev/2005/Aug/msg00506.html
I hope that helps. I’m 90% sure it is the cause of your class not found
error.