«

»

Jun 26

First disappointment with Ruby on Rails!

It’s taken some time, but I’ve finally found something significantly unsatisfactory in RoR.  Debugging support.

Essentially, you have to add the breakpoint method to your code wherever you need a breakpoint.  That’s odd, but reasonable.  Then, in a seperate command shell, start up the breakpointer.  (This can all be found here)

A little confusing, but so far, so good.

The irb that is created from this is a ruby shell, not a debugging shell.  This means:

  • you can’t step
  • you can’t drill down

All you can really do is inspect, tweak values, add code and either abort or exit, allowing the program to continue.

Not a very satisfactory debugging environment.   And it is apparently the “official” debugging environment for Rails.

Unhelpful Advice

Worst part is the comment to this post:

Proper test coverage should reduce a need to debug your application. The question is: how good is your test suite? 😉

You know, that’s what I really was looking for.  Someone telling me that if I was better at writing unit tests, I wouldn’t need to  use the debugger.  Of course, this commenter has no idea what kind of problem the writer is having.
That was probably the most annoying thing in this whole scenario.  Ruby programmers arrogant?  nah….

Resolution 

Anyways, using IRB, I was eventually able to figure out that, as far as I can tell, my  RoR (ruby 1.8.2, rails 1.1) installation is inconsistent with the documentation, from a number of angles.  Specifically:

  • the SOAP::WSDLDriverFactory has a create_driver method only.  No create_rpc_driver method, like the documentation says.
  • the Web Services With Rails document from O’Reilly is the one that told me to use create_rpc_driver, so it too, is apparently incorrect.

(Caveat: it is perfectly likely that somehow my installation is incomplete or out of date, but I don’t know how to check, beyond simply looking at my versions of Ruby and Rails.  I suppose there may be an older version of some libraries on this machine, but as far as I know, that is not the case)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>