Shear my yak? (deeper debugging)

Word up and thanks to those that continue to contribute positively to
the group.

I am about to lop off my left nut to get to the bottom of a strange
behavior I’m witnessing.

Rails somehow can’t find an action name called ‘start’ in any of my
controllers. Rename it to, say, ‘startx’, load that url, and it works
as expected.

Before I go off shearing this yak any further, can anyone please
suggest how I should go about debugging this? I’d like to be able to
discover exactly where in the stack Rails is somehow not

I realize continual test coverage across my controller actions might
have prevented the hairiness of this yak that stands before me. I’ll
light a TDD candle later.

Right now, I’ve gotta shear this here yak. I have tried:

  • removing all plugins
  • removing all my custom routes
  • tried the action in different controllers
  • opened a breakpointer in the controller
  • making sure I haven’t used ‘start’ in some funny way anywhere in the
    app
  • tried the action declaration in different controllers
  • created a new rails app and could not replicate the problem
  • asked the Google
  • begun to shave the yak’s genitals

All I want is an action called start, like I have had many times in
the past (sans yak).

I’m about to do some more playing with the debugger, and create a
functional test against the controller.

Thanks for reading.

tshim wrote:

  • begun to shave the yak’s genitals
    You went thru all that labor before just writing one stinking
    functional test???

(Did you grep \bstart\b . -r all the code?)

I realize continual test coverage across my controller actions might
have prevented the hairiness of this yak that stands before me. I’ll
light a TDD candle later.

That’s not TDD - you didn’t test FIRST.

Have we learned our LESSON yet???

I did go through the results of grepping ‘start’ – truly, nothing
suspicious there.

There is hair everywhere now. I’ve created a new rails app, declared a
simple controller and two actions, ‘start’ and ‘startx’.

Each url responds as expected via the browser.

Two simple functional tests,

def test_start
get :start
assert_response :success
end

def test_startx
get :startx
assert_response :success
end

reveal that test_start fails while test_startx passes. However, as I
just wrote while coughing on yak hair, both actions in the fresh app
respond appropriately in the browser.

Anyway, I’m sure I can get to the bottom of this if I just knew how to
get ‘deeper’ in tracing the rails stack. Any tips?

Anyway, I’m sure I can get to the bottom of this if I just knew how to
get ‘deeper’ in tracing the rails stack. Any tips?

Post your routes.rb, and your rails -v version?

On 8 Jul 2008, at 05:07, tshim wrote:

Before I go off shearing this yak any further, can anyone please
suggest how I should go about debugging this? I’d like to be able to
discover exactly where in the stack Rails is somehow not loading the
class properly.

Thanks for taking the time to reply, Phlip.

I’m running Rails 2.1.0.

It’s because you’ve got the debugger enabled (rails enables it in
tests by default with 2.1).
rdebug defines Kernel#start which means that ActionController
considers the method not to be an action (Long version here:
It's always the butler - Space Vatican)

Fred

Thanks for the tip Frederick. That is exactly the issue.

A ticket was opened for ruby-debug, and it looks like it was fixed in
r848 at the very same time I started whining to the group about my
yak.


action named start
action called start

On Jul 8, 2:39 am, Frederick C. [email protected]

Before I go off shearing this yak any further, can anyone please
suggest how I should go about debugging this? I’d like to be able to
discover exactly where in the stack Rails is somehow not loading the
class properly.

Thanks for taking the time to reply, Phlip.

I’m running Rails 2.1.0.

My routes: http://pastie.org/229541

The stacktrace: http://pastie.org/229542