Ruby on Rails Makes a Funny

I love Ruby on Rails. It is normally as intuitive as it gets, so needless to say, I was surprised when I got the following error:

Expected Object is not missing constant ContactNotifier!

Ah, I thought. I did not define a constant (a common bug). Then I did a double take. The error told me, in fact, that I was NOT missing a constant. Huh?

The problem was that I was calling “new” on an ActionMailer class and I had not defined a constructor. I later found out I should not have been instantiating an ActionMailer class anyway (you just need to call a delivery method with the parameters you want to send). Regardless, why the heck does Rails throw such a cryptic error instead of, say, “Method not found”?

    This entry was posted in Technology. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

    Post a Comment

    Your email is never published nor shared. 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=""> <strike> <strong>