Ruby and Rails — How NetBeans Changed my Life
From version 6.0 on, the NetBeans IDE's support for Ruby is as comprehensive as it is for Java, covering the full edit-compile-test-debug cycle for Ruby and Ruby on Rails. Klaasjan Tukker, the president of the Dutch Java User Group NLJUG, web developer Michael Slater, software industry analyst Michael Coté, developer and software consultant Charles Lowell, and the Java technology consultant Joe Bowbeer, were among the first ones to give the new Ruby features a try. Here is what they said!
The First ImpressionKlaasjan Tukker first came into contact with Ruby and Ruby on Rails in 2006. Like many Ruby developers he soon felt that, instead of a text editor, he needed an IDE that understood Ruby code semantically. "Having worked with Java and PHP, Eclipse was the IDE of my choice, and so I downloaded the RadRails plugin. The plugin supported basic Rails commands like scaffolding and project creation. Code highlighting and 'templating features' were not quite common at that moment," Tukker remembers. "Early 2007 I got hooked on the NetBeans module for Ruby and Ruby on Rails," Tukker adds. "In my day-to-day job, I manage an in-house Java development team. In the evening hours, I've built a simple membership administration system for the NLJUG. NetBeans supported this development quite nicely."
Michael Slater has a similar story to tell. He develops web applications with the Ruby on Rails framework and he too was using RadRails. Then in July 2007, one morning changed his (work) life. "[T]his morning I downloaded NetBeans. It took me about two hours to download it, figure out how to use all the core Rails features, and get a few projects imported into it from my Subversion repository. By the end of those two hours, I knew I'd be unlikely to use Aptana [RadRails] again," Slater writes in his weblog.
NetBeans Tip: Did you know that Control-K automatically completes any previously typed strings from within the same editor? Similarly, Control-L completes previously typed strings found after the insertion point. Press either shortcut repeatedly to cycle through all possible completions.
Features and User InterfaceAlthough the full version of NetBeans IDE 6.0 will only be released in a couple of months, you can already test current development builds and give feedback on new features. "The speed of development of the team is amazing. The cutting-edge features are mostly built upon the latest builds of NetBeans IDE 6.0," Tukker describes the results of his hunt for the best tool. "I became a frequent visitor of the Development Download section of the NetBeans website. About once a week, I update my installation to the latest NetBeans IDE 6.0 and Ruby IDE build."
Michael Slater still recalls his first impression of the Ruby project support: "Some of the features I immediately appreciated were the code hinting, ability to split the editor window into multiple panes either horizontally or vertically, better UI for accessing generators and Rake tasks, highlighting of the begin and end of Ruby methods, blocks, and HTML statements, and marking of where in each file code has been deleted and inserted."
NetBeans Tip: Use shortcuts to speed up your work:
Typing a colon and then hiting the tabkey inserts
a hash entry of the form
Web application developer Michael Slater is of course especially intersted in the IDE's Ruby on Rails features. "The appeal has at least as much to do with Rails and with Ruby, for which you need easy access to lots of files," he comments on the quality of the user interface; "It helps to have easy access to Rake tasks, starting Rails servers, and other Rails-specific items." Charles Lowell's favorite NetBeans feature is the Ruby debugger. "You can use the cruby debugger or jRuby; Netbeans by default uses the jRuby VM for your projects, but there is no reason you can't run it with regular Ruby. Either way, you get really nice debugging hooks into the code," Lowell points out in his and Coté's recent podcast. "As you're stepping through the debugger, all your code browsing, completion, documentation information, it's all there, in a way that it's not in Eclipse or Textmate. So I do use it for debugging, really sweet." So, is there nothing more to wish for? Well, almost nothing. "There are always nice features you could wish for," Tukker admits, "like a colored output console, or an integrated
Conclusion"I find it amazing that products of the richness of Aptana and NetBeans are free," Slater complements the NetBeans and Aptana development teams in closing. "They're easily as deep and sophisticated as most of Adobe's $500+ products, for example, and they're evolving a lot more quickly."
NetBeans Tip: Did you know that you can open files that are not part of a project in the Favorites window? Select Windows > Favorites for a customizable file browser. You can also choose Navigate > Go to File or Go to Type from the menu to search for files and resources in your projects.
Get NetBeans IDE for Ruby
Installation and Download
Note: As an alternative, a prototype Ruby IDE build exists with only cvs/subversion, local file history, Ruby, and Rails installed. Get the Ruby-only NetBeans IDE here.
How to import and run Ruby Projects in NetBeans
You want to integrate your Ruby scripts with Java code? Then we recommend using the default JRuby interpreter. JRuby runs on the Java Virtual Machine and is already built into the IDE. In all other cases, feel free to set the IDE to use your system's Ruby interpreter.
You can always go to the Miscellaneous Options > Ruby panel to switch from one Ruby interpreter to the other. Note that switching to another Ruby interpreter also switches to the associated Rails interpreter.
To get started: