Software dev, tech, mind hacks and the occasional personal bit

JRuby Setup

Recently got a JRuby/Rails system with Java integration up and running. Unfortunately, it took quite a few hours, as most of the docs and code you find through Google are out of date.

If you use JRuby 0.9.2 from Codehaus, you will get an error similar to this when you try to access a rails application:

[2007-02-26 17:54:59] INFO WEBrick::HTTPServer start: pid=22540508 port=3000
<ArgumentError: Anonymous modules have no name to be referenced by>
[“c:/jruby-0.9.2/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:402:in `to_constant_name’…

If you’re stuck in this rut, fear not! Nick Sieger has written very helpful instructions which outline how to get and set up the latest development snapshot. Please note that in addition to the instructions, you need to set your JRUBY_HOME environment variable. Under Windows, do something like this:

set JRUBY_HOME=c:\jruby

If you’d prefer not to use the snapshot, you can get the source code through subversion from:

http://svn.codehaus.org/jruby/trunk/jruby

but at the time of this post, you need to run svn checkout or update with “–ignore-externals” to avoid the following error:

Error: URL ‘svn://rubyforge.org/var/svn/bfts/bfts/trunk’ doesn’t exist

Many thanks to Nick Sieger and the JRuby user mailing list for their help.

Previous

Holiday 2007 – Venice and Padua

Next

_vimrc for Ruby

2 Comments

  1. akshay

    [2007-02-26 17:54:59] INFO WEBrick::HTTPServer start: pid=22540508 port=3000
    “ArgumentError: Anonymous modules have no name to be referenced by>
    [“c:/jruby-0.9.2/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
    active_support/dependencies.rb:402:in `to_constant_name’…

    This happens when jars(like bcprov) required by ActiveRecord JDBC/rails-integration are not in classpath. In my case i had to add it the glassfish`s lib folder

  2. Nick Sieger

    Thanks for the writeup James.

    We’ll endeavor to improve and update the documentation for the new release, due out shortly. Stay tuned!

Powered by WordPress & Theme by Anders Norén