Expected X to define Y error
I just got hit by this famous error again. And I am not the only one:
- Aug 2006: Expected … to define …
- Dec 2006: Weird error trying to define controller?
- Jan 2007: rails 1.2.1
- Ticket #7452 (there are more)
- Google search on this error message
Now, I know I should put my patches where my mouth is. And that’s exactly what I’m trying to do here. My application is on the 1.2 branch, and I get this error if I have the Response Logger plugin loaded. Trying again with Edge Rails, I again get the error. If I try with WEBrick or Mongrel, same error. Loading the console produces the same error. Using Windows or Linux changes nothing: same error.
The exact backtrace is:In this application, I am using Engines, along with LoginEngine. You really need the right version of Engines with the right version of Rails for things to work out well: Rails 1.2 requires Engines 1.2.
October 12th, 2007 at 10:25 PM
The problem with weird bugs like this is that if your app is complex enough, creating a viable test case can be kind of daunting. I’ve found a bug in Rails in the error reporting where recreating the error is so weird and detailed that I’ve never gotten around to making a patch, because the test case would be nightmarishly involved, even though fixing the bug itself is pretty straightforward. (I kind of feel like I should be a better citizen than that, but I don’t see how I’m going to do it.)