Thursday Nov 22, 2007

I ran across this late yesterday night and thought I should share: If you are using NetBeans for your Ruby on Rails development and you are fond of creating custom rake tasks (as I am due to this awesome podcast), you need go around the NetBeans' GUI in this release. If you create the rakefile through the GUI, it will have a .rb extension (instead of the .rake extension) which Rails doesn't grok as a custom rake task. I get around it this way this way:
  1. open a terminal and cd into your Rails application directory.
  2. touch your custom rake file (with .rake extension) inside lib/tasks with something like:
    touch lib/tasks/example.rake
  3. edit your custom task in the NetBeans editor and create the actual rake task. Maybe something like this excellent db:seed task.
  4. use the Netbeans GUI to refresh your rake tasks (right-click the project and choose Run Rake Tasks > Refresh List
    refresh_rake_tasks.jpg
Hopefully, this will be added to the NetBeans 6.1 (per this bug request). Thanks to this entry at Quoted-Printable for the cool seed rakefile idea.

This blog copyright 2009 by ken pepple