Tuesday, May 27, 2008

JRuby pains

I was dickering with JRuby for three days trying to get it to run, I kept getting all kinds of strange errors.

I found out that calling JRuby is actually calling a batch file that deals with compiling things to run as java, so I turned echo on in it and the batch files that it calls. I started tracing the route through looking for the problem.

My environment variables Path, jruby_home, and Java_home were all 3 correct. From a command prompt I could type "java-version" and get 1.6.0_05 and yet, it was giving me a strange error. The only thing I found online for that error was that it was using the wrong version of the runtime, but the runtime and java were fine. Or so I believed.

I went to a different machine and tried installing the Bin version of JRuby1.1.1. It worked. I knew that nothing could be wrong, even inadvertently with the bin code on the web since it worked perfectly on the first attempt on another computer.

Back to the first computer I went. I don't know what brought it on, but for some reason I decided to check that the version of java in java_home matched the version in my path. It didn't. Java_home was using 1.4.2. I updated the environment variable to point to the correct version and everything worked.

If you are having strange errors and your computer has multiple versions of Java installed, you may want to verify that you have the right versions in your environment variables.

No comments: