NetBeans 6.0 Beta 1 Available

written by nap on September 19th, 2007 @ 09:56 AM

NetBeans 6.0 Beta 1 is out and ready for download, including a slimmed-down Ruby-only version for those of you who don't want all the extras. Personally I like having one IDE for both Java and Ruby but hey, I'm special. As I've written about before, I'm quite smitten with NetBeans and this latest release is the best yet. If you're curious about why I'm gushing over it, read here, here, and here.

So yeah, it's nice. Go download 6.0 Beta 1 and give it a try. It's packaged with JRuby 1.0.1 and Glassfish v2, which is starting to look more and more attractive as a serious deployment option for Rails.

PS: those of you who are frustrated with Goldspike may want to take a look at Nick Sieger's Warbler, an alternative for packaging up your WAR files.

PPS: you don't have to use JRuby as your interpreter of course. Just go to preferences -> Ruby and point it at MRI (/usr/bin/ruby or whatever) if you don't want / need / like JRuby. And then you can use the fast debugger too. Inline Ruby debugging rocks.

Swing Reduction Sauce

written by nap on July 11th, 2007 @ 08:03 PM

JRuby continues to develop in interesting ways. Earlier today, Zed Shaw (Mongrel's dad) announced the release of Profligacy 1.0, which you should take a look at if you've got a thing for building cross-platform desktop apps in Ruby. It's pretty cool.

Profligacy is a (wildly extravagant?) library that purports to take the pain out of using Swing components with JRuby. It uses LEL, Layout Expression Language, to bring a sort of wiki-ish flavor to component layout. This is truly bizarre at first glance, but damn cool at the same time. Basically the Ascii art you lay out with LEL translates into a Swing GroupLayout. Ah-wha? Yep. Check out some examples. I told you it was cool.

It also does some other neat stuff like auto-converting procs to Listener interfaces, but I won't go on about that, as you can go check the release notes instead. If you've ever worked in Swing before, you know how painful it can be. Profligacy makes it significantly less bitter to swallow. Now stop reading blogs and go build your first cross-platform Ruby desktop app. You know you want to.

JRuby / Goldspike / Glassfish Deployment Diary

written by nap on June 11th, 2007 @ 12:01 PM

Robert Dempsey has written a pretty solid little tutorial on deploying your first JRuby on Rails app with Glassfish. It's powerful stuff. Go read it now, damnit!

The process can still be a bit tricky the first time, especially if you have additional gem dependencies, etc. But once you get it running you'll be blown away by how simple it is to create a .war and deploy it to any of numerous pre-existing Java application servers (Glassfish).

I had a few issues initially (particularly with openssl support), so I figured I'd document them as an addenum to Robert's tutorial in case you're interested. Read on to see my notes...

  • Make sure to set JRUBY_HOME in your environment. It's used by Goldspike.
  • If both ruby and jruby are in your path, you can specify the 'version' of rake to use by doing: jruby -S rake. This will run the specific command in the JRUBY_HOME/bin directory.
  • Edit the goldspike lib/war_config.rb and change the line that reference jruby-complete version 0.99 to read:

    add_java_library(maven_library ('org.jruby', 'jruby-complete', '1.0'))

  • This will look for JRuby 1.0 instead of 0.9.9. As of this writing you'll also have to manually retrieve jruby-complete-1.0.jar as the remote sources don't seem to have it yet. Put it in JRUBY_HOME/lib.

  • I happen to be using SSL in my app, so I had to gem install it into the JRuby environment using jruby -S gem install jruby-openssl Make sure the gem ends up in your JRUBY_HOME/lib/ruby/gems hierarchy. Tell goldspike it needs to add this gem with the following line: add_gem('jruby-openssl')

  • If you're doing the jruby-openssl thing you'll also have to retrieve the latest version of the Bouncy Castle Crypto APIs package for whatever version of Java you're using (I'm on OS X, Java 1.5). Put this in your JRUBY_HOME/lib directory and then add the library to your war_config.rb file:

    add_java_library(maven_library('bouncycastle', 'bcprov-jdk15', '136'))

UPDATES:

  • Make sure to copy jdbc_databases.rake from ActiveRecord-JDBC to your lib/tasks directory (for ActiveRecord-related rake tasks). Thanks to Ola Bini for pointing me in the right direction there.

  • Include the following in environment.rb:

    if RUBY_PLATFORM =~ /java/ require 'rubygems' RAILS_CONNECTION_ADAPTERS = %w(jdbc) end

JRuby Reaches 1.0

written by nap on June 10th, 2007 @ 09:54 AM

JRuby 1.0 has been officially released. This is huge news. Complete compatibility with Ruby 1.8 is pretty much a done deal. Rails apps run. You can deploy your Rails apps in Glassfish. I mean, how cool is that?

You should check out team member Charles Nutter's blog for more details. In a nutshell, the future looks like tighter integration with Java as an application platform, and a major focus on optimizing performance. Also a lot of interest in Ruby 1.9/2.0. If you attended Railsconf this year, you most likely got pretty excited about JRuby, and for good reason.

If you've never tried it out before, Atlantic Dominion Solutions has put together a great tutorial on getting started with JRuby on OS X. Or, even easier, go get yourself a copy of NetBeans 6.0 M9, which comes bundled with JRuby as the default interpreter for in-IDE development.