Tuesday, February 27, 2007

Ruby development support advancing in NetBeans 6

As an outsider looking in it's difficult to determine when the time is right to try out new bleeding-edge NetBeans features. One new feature being developed for for NetBeans 6 is Ruby and Rails support. It doesn't come bundled with the latest milestone release (7). Instead you have to download it from the Update Center.

The Update Center modules are in a folder labeled 'Ruby'. With the Ruby modules NetBeans acquires the tools to create Ruby projects as well as create Rails projects that run on top of the Ruby tools. Unlike Eclipse's Ruby support, NetBeans uses JRuby entirely. There might be arguments as to which is better, but having tried both I see no advantage of one over the other. If there is any kind of advantage then it would be with NetBeans, since it can be installed and run without an external Ruby installation. But I can't imagine a Ruby developer not having a Ruby installation. Nor could I imagine a developer choosing JRuby over standard Ruby. JRuby is slower, and compared to the upcoming YARV, much, much slower. See "Ruby Implementations Shootout: Ruby vs Yarv vs JRuby vs Gardens Point Ruby .NET vs Rubinius vs Cardinal" for further details. I'd recommend that if you use NetBeans Ruby to develop and initially test, then deploy to regular Ruby to finish testing.

I also learned why Tor Norbye is called "a programming machine" and "epic". Yes. He is. I could not create a Rails project when I first installed the Ruby modules from the Update Center. So I sent an email to Charles Ditzel with a cry for help. Charles forwarded it to Tor. And Tor then replied back. We passed a number of emails between us, but in less than 12 hours Tor had solved the problem and provided a solution. It turned out that the update center modules were missing two files; activesupport-1.3.1.gemspec and activerecord-1.14.4.gemspec. Tor sent me the files, I dropped them where they were supposed to be, and bingo! Everything worked after that. There's even a bug (with fix) filed against the problem.

Here's a successful creation of a Rails application, and the automatic startup of WEBrick within the IDE running on OpenSuse 10.2.

Followed by the ubiquitous Rails stock web page.

Being an initial release running in a NetBeans milestone (essentially an alpha), there are some rough edges. But that's to be expected. I hope, as a user, I can provide quality feedback to make Ruby support as successful as I believe it can be. Far more valuable than the technology being developed are the people developing the technology. I've 'met' a lot of really great people lately as I've written about my various experiences with Suse, Ubuntu and NetBeans. Tor Norbye and Charles Ditzel are two more super folks. Thanks guys for all your help.


  1. Thank you so much for the compliments!

    One comment on JRuby: JRuby and Rails are bundled to give you a very nice and clean out-of-the-box experience. No fiddling with other installers, modifying PATH variables, etc. (Unfortunately as an early adopter it didn't work out that way for you - but it should be easier for everyone else now that most of the issues are resolved.)

    You can however use native ruby and rails if you want. You can modify it under Tools | Options (Preferences on the Mac) under Miscellaneous. There are apparently problems with this on Windows; there is some documentation of the issue

    On Linux it worked for me - but note that you have to restart after modifying the ruby pointer. See
    issue 89234 for more.

    Yes, I will try to make this more intuitive, something ala the Java Platform manager.

  2. Performance is about to become the primary goal for JRuby development, so rest assured we're working on it. And of the benchmarks in that shootout, JRuby is already faster than MRI for the ones we can compile with our prototype compiler. Things should improve very quickly over the next two months.

  3. Any change anyone else can get the two files need to make ruby work in netbeans?


  4. As a matter of fact Ruby language was created much earlier than even PHP, but it was used for the most part in Japan. The situation remained like this until Rails came in, owing to David Heinemeier Hansson. Combined Ruby language and Rails framework, or simply Ruby on Rails, have become a powerful and highly effective tool in developing web applications, used by programmers all around the globe. Moreover, Ruby has a great future as it's quite possible that in a few years other even better frameworks designed for it will appear. ruby on rails canada


All comments are checked. Comment SPAM will be blocked and deleted.

Note: Only a member of this blog may post a comment.