I am giving a JRuby presentation at the No Fluff, Just Stuff Symposium in St. Louis this weekend. With the recent announcement of JRuby 0.9.8, I am sure the first question on everyone's mind is "When will JRuby be production ready?"
To me, the only way to answer this question is to run some real apps in JRuby, and see what problems arise. However, most of the tutorials out there assume a green field application. That is unrealistic for enterprise developers like myself. We have dozens of existing Rails applications to support.
So, I set out to write a plugin that would let an existing Rails application run either in native Ruby or JRuby. I have open-sourced the result. You can add the J plugin to your Rails application with
script/plugin install http://svn.streamlinedframework.org/j
J is very simple. Currently it only works with MySQL Rails apps, and only in *nix shell environments. Once you install it, all you do is
rake j:setupSee the j.rake file and README for more usage info. Here's what I can tell you so far, having pointed J at three real-world web applications:
- One of the three UIs ran correctly immediately. With the other two, I have uncovered different library behaviors between JRuby and native Ruby. I will take these over to the JRuby mailing list and report back on the solutions.
- Testing tasks do not run, because Rails' databases.rake does not handle JDBC drivers yet. This should take only a few hours work, and I am hoping that someone has done it already.
Comments
Sorry I missed this conference. I think we need more of these kinds of symposiums, for those of us interested in learning more but without the high pressure sales. In looking at what you were planning to present, though, I wonder if you have any thoughts on Java’s future. I have read recently about how Mac has essentially severed ties to Java, most notably in the new iPhone. Given that so many forecasters are predicting that eventually we will all use mobile devices to access the net, rather than PCs or Laptops (in Asia this is already the case), and given that iPod has now set the standard for the industry by creating the first phone that can really do this, does this put Java in jeopardy? Of course, this is a prediction, and as with all predictions dependent on the way the future unfolds, but I’m curious if there is any talk of this danger among those who work with Java?
What I know is that Xcode for self-contained JRuby application bundles for OS X is already complete. This was an experimental code however and was said to be containing bugs. They work like work like normal OS X apps because they have regular OS X menu bars, Finder icons, and dock icons. Moreover, according to Ruby users and the JRuby team, once a Rails app is packaged as a .war file, you can deploy it to any Java application server. JRuby on Grizzly 1.5 is also now ready. It is believed that eventually it can replace your Mongrel or WEBrick native WebServer with the pure Java Ruby Bear. And the latest, it is now possible to deploy Ruby on Rails applications on Glassfish. Utilizing JRuby and its growing support for Rails, Glassfish can now be used as a production platform, allowing a more robust and scalable deployment platform.