Is there any way to use the command line to debug an ERB file? I would like to know if there is any way to get rdebug or rdebug-ide to do this.
A:
There probably is, but I have been doing the equiv of print.
puts YAML::dump(variable)
easement
2009-11-19 17:45:41
Yes, I can do this, but I'm trying to build a web page front end for the ERB debugger, so really need something that can do it programmatically. So far I can't find anything like ruby-debug. I have heard netbeans can do it but its not documented anywhere.
Zubair
2009-11-19 18:11:20
A:
Try something like, STDERR.puts "Debug message"
and it'll appear in the console window or in your log if it's Rails or Sinatra.
The Wicked Flea
2009-11-19 17:52:42
This can be done in standard Ruby too, to print debug statements, but I'm looking for a debugger which allows you to manually step through the code programatically.
Zubair
2009-11-19 18:12:34
+1
A:
What if you monkey patch the method you need, and you include a call to debugger
? You'd need the ruby-debug
gem for the debugger
method.
Geo
2010-02-16 09:11:38
I have since stopped trying to do this, but at the time I was going to do something like that. Its just s shame it had not already been done
Zubair
2010-02-16 10:59:51