views:

347

answers:

1

All of this is on a windows xp box:

Netbeans managed to accept an existing rails project and allowed me to debug it just fine, but my project has a number of processing scripts that handle non-MVC aspects. The rails project is just a system for queuing requests for the execution of these scripts.

I've attempted to create netbeans projects using existing sources, but it fails for a number of reasons.

First, since I have a number of scripts in one place, netbeans complains that I can't add a source directory to the project because it already belongs to another project. If I put the script into its own, empty, directory and try to add that directory, netbeans stalls while trying to create the project and I have to end the process from the task manager.

If I create a new project for it, remove the default main.rb and replace it with the script I want to debug, the debug session will not start - netbeans complains that it cannnot find the program entry point.

It seems to me that if I can debug rails apps as easily as netbeans allows me to, that running a single standalone script would be trivial. What on earth am I missing?

UPDATE: Loading the script and doing "Debug/Debug File" isn't possible. The option is always greyed out, even for hello world.

+1  A: 

Right click on the project, click Properties, choose Run, and change the Main Script to your script.

You can also debug a single file in Rails project by opening the file, then click Debug in menu toolbar, then Debug "file_name.rb". Or just press Ctrl-Shift-F5 on the opened file.

htanata
The option to debug a single file is greyed out for me. See the update on the original question.
I'm clueless. Probably you should ask at NetBeans mailing list. There is one specialized in Ruby. http://www.netbeans.org/community/lists/top.html
htanata