Hi guys, Now I own rails application for my website. But when some changes happens, the debug way will be bramble. Is there any IDE or method release it? I mean if you would like to debug the java program, you can set the breakpoint in the Eclipse or NetBeans. But in Aptana, I feel it is difficult to debug my application. Is there any suggestion or advice?
Well tools for rails or ruby aren't as mature as java. But at a basic level if you start your server with --debugger and then call debugger() anywhere in your app then you application will stop when it hits that. It's a command line interfact but you can do the usual stuff (inspect state, step through code etc...). 3rd rail claims to have a whizzy graphical thing (http://www.codegear.com/article/ 37968#2FastDebugging) but i've never used 3rd rail so I couldn't say what it's like.
Fred
I'ld strongly recommend the console debug tools using the debugger() method. It is extremely effective and easy to use once you get the hang of it.
Now I own rails application for my website. But when some changes happens, the debug way will be bramble. Is there any IDE or method release it? I mean if you would like to debug the java program, you can set the breakpoint in the Eclipse or NetBeans. But in Aptana, I feel it is difficult to debug my application. Is there any suggestion or advice?
Write unit tests for every feature.
A test that calls a method is like a breakpoint on that method, and an assertion that compares its return value to a reference is like watching a variable.
Better, you don't need to debug over and over and over again when you change anything. You just run all the tests.
Well tools for rails or ruby aren't as mature as java. But at a basic level if you start your server with --debugger and then call debugger() anywhere in your app then you application will stop when it hits that. It's a command line interfact but you can do the usual stuff (inspect state, step through code etc...). 3rd rail claims to have a whizzy graphical thing (http://www.codegear.com/article/ 37968#2FastDebugging) but i've never used 3rd rail so I couldn't say what it's like.
I have been using Rails for nearly two years - about 6 apps - and I have never once invoked the debugger. Neither has my current team, who has been Railing for almost 3 years.
If you are using Windows you may want to try Ruby In Steel. we have the fastest debugger for standard Ruby with all kinds of visual debugging including:
- breakpoints - conditional breakpoints - trace points - run macro on break - drill-down watch variables - hover+drilldown inspection - dynamic debugging (change values while debugging) - call stack navigation - set breakpoints and debug into ERb/Rhtml - JRuby debugging - step into/out/over - and lots, lots more...
More info here:
http://www.sapphiresteel.com/Debugging-Ruby-with-the-Cylon http://www.sapphiresteel.com/Dynamic-Debugging-In-Ruby http://www.sapphiresteel.com/Ruby-Debugger-Enhancements http://www.sapphiresteel.com/How-To-Debug-Ruby-Inside-RHTML
best wishes Huw Collingbourne
SapphireSteel Software Ruby and Rails In Visual Studio http://www.sapphiresteel.com