Forum: Rails deployment Custom 500/Application Errors

30e88814f7ea9460f50cc6faf7fe43ef?d=identicon&s=25 Alex Williams (daaaman64)
on 2008-08-25 21:34
Hi, I'm working on creating custom 500 errors in rails 2.1. Specifically
I'm trying to send an email with the exception every time an application
error occurs.

So I follow these instructions:

http://wiki.rubyonrails.org/rails/pages/HandlingPr...

It tells me to put an error handler in /lib/ then require it in
environment.rb.


HOWEVER, when I past it's code, creating something called an
"ActionController", I can no longer start mongrel. Because of
"uninitialized constant ActionController"

Whats the deal?

Please help!

Thank you
A82ba1167f4d4a8d1de63820e576a87f?d=identicon&s=25 Robby Russell (Guest)
on 2008-08-25 22:14
(Received via mailing list)
On Mon, Aug 25, 2008 at 12:34 PM, Alex Williams
<ruby-forum-incoming@andreas-s.net> wrote:
> environment.rb.
>
>
> HOWEVER, when I past it's code, creating something called an
> "ActionController", I can no longer start mongrel. Because of
> "uninitialized constant ActionController"
>
> Whats the deal?
>
> Please help!
>

Alex,

There are a few options for this. The typical solution is to use the
Exception Notification plugin.

* http://github.com/rails/exception_notification/

This plugin will let you define email recipients to direct
exceptions/errors to. You can take a look at the README for
instructions on installing and configuring.

Additionally, there are also a few web services that provide APIs that
you can direct exceptions to. I've been a beta tester for Exceptional,
which our team is using across five client projects in production
right now with great success. You might look at this as a solution
once they open it up to more customers.

* http://getexceptional.com/

Another new comer to this arena is Hoptoad, which I haven't had a
chance to play with yet.

* http://www.hoptoadapp.com/

Good luck!

Cheers,
Robby



--
Robby Russell
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting

http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
30e88814f7ea9460f50cc6faf7fe43ef?d=identicon&s=25 Alex Williams (daaaman64)
on 2008-08-25 23:05
Robby Russell wrote:
> On Mon, Aug 25, 2008 at 12:34 PM, Alex Williams
> <ruby-forum-incoming@andreas-s.net> wrote:
>> environment.rb.
>>
>>
>> HOWEVER, when I past it's code, creating something called an
>> "ActionController", I can no longer start mongrel. Because of
>> "uninitialized constant ActionController"
>>
>> Whats the deal?
>>
>> Please help!
>>
>
> Alex,
>
> There are a few options for this. The typical solution is to use the
> Exception Notification plugin.
>
> * http://github.com/rails/exception_notification/
>
> This plugin will let you define email recipients to direct
> exceptions/errors to. You can take a look at the README for
> instructions on installing and configuring.
>
> Additionally, there are also a few web services that provide APIs that
> you can direct exceptions to. I've been a beta tester for Exceptional,
> which our team is using across five client projects in production
> right now with great success. You might look at this as a solution
> once they open it up to more customers.
>
> * http://getexceptional.com/
>
> Another new comer to this arena is Hoptoad, which I haven't had a
> chance to play with yet.
>
> * http://www.hoptoadapp.com/
>
> Good luck!
>
> Cheers,
> Robby
>
>
>
> --
> Robby Russell
> Chief Evangelist, Partner
>
> PLANET ARGON, LLC
> design // development // hosting
>
> http://www.planetargon.com/
> http://www.robbyonrails.com/
> aim: planetargon
>
> +1 503 445 2457
> +1 877 55 ARGON [toll free]
> +1 815 642 4068 [fax]

Thank you for the Fast response. I am trying to install
exception_notifier. Now it isn't working, but I have a feeling it's
something simple I just don't know about.

I downloaded exception_notifier and put it in my plugins folder like the
reset of 'em are.  I pasted the line:

include ExceptionNotifiable

in my application folder as asked.

then I added this to environment.rb:

ExceptionNotifier.exception_recipients = %w(joe@schmoe.com
bill@schmoe.com)

Essentially I was just testing defaults. However, I receive the error
"uninitialized constant ExceptionNotifier"

So what do I need to do to get ExceptionNotifier working?  It may be
something I simply don't understand about installing plugins this way.

Thank you I hope hear from you.
A82ba1167f4d4a8d1de63820e576a87f?d=identicon&s=25 Robby Russell (Guest)
on 2008-08-25 23:19
(Received via mailing list)
On Mon, Aug 25, 2008 at 2:05 PM, Alex Williams
<ruby-forum-incoming@andreas-s.net> wrote:
>>>
>> * http://github.com/rails/exception_notification/
>>
>> Robby
>> http://www.planetargon.com/
>
> I downloaded exception_notifier and put it in my plugins folder like the
> reset of 'em are.  I pasted the line:
>
> include ExceptionNotifiable
>
> in my application folder as asked.

Just to clarify... you meant application controller?


> Essentially I was just testing defaults. However, I receive the error
> "uninitialized constant ExceptionNotifier"
>

Hmm, I don't think that you need to require this in your
environment.rb. It might not be initializing the plugin.

Robby


--
Robby Russell
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting

http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
30e88814f7ea9460f50cc6faf7fe43ef?d=identicon&s=25 Alex Williams (daaaman64)
on 2008-08-25 23:43
Robby Russell wrote:
> On Mon, Aug 25, 2008 at 2:05 PM, Alex Williams
> <ruby-forum-incoming@andreas-s.net> wrote:
>>>>
>>> * http://github.com/rails/exception_notification/
>>>
>>> Robby
>>> http://www.planetargon.com/
>>
>> I downloaded exception_notifier and put it in my plugins folder like the
>> reset of 'em are.  I pasted the line:
>>
>> include ExceptionNotifiable
>>
>> in my application folder as asked.
>
> Just to clarify... you meant application controller?
>
>
>> Essentially I was just testing defaults. However, I receive the error
>> "uninitialized constant ExceptionNotifier"
>>
>
> Hmm, I don't think that you need to require this in your
> environment.rb. It might not be initializing the plugin.
>
> Robby
>
>
> --
> Robby Russell
> Chief Evangelist, Partner
>
> PLANET ARGON, LLC
> design // development // hosting
>
> http://www.planetargon.com/
> http://www.robbyonrails.com/
> aim: planetargon
>
> +1 503 445 2457
> +1 877 55 ARGON [toll free]
> +1 815 642 4068 [fax]

Yes application controller, sorry :)

I'm follow the instructions from the website you posted. Here they are:

----------
First, include the ExceptionNotifiable mixin in whichever controller you
want
to generate error emails (typically ApplicationController):

  class ApplicationController < ActionController::Base
    include ExceptionNotifiable
    ...
  end

Then, specify the email recipients in your environment:

  ExceptionNotifier.exception_recipients = %w(joe@schmoe.com
bill@schmoe.com)

And that's it! The defaults take care of the rest.
-----------

But again it isn't initializing "ExceptionNotifier", so what should I
do?

I put the download right into the plugins folder so it looks like:

/plugins/exception_notfier/
lib
test
views
INIT.rb
README
30e88814f7ea9460f50cc6faf7fe43ef?d=identicon&s=25 Alex Williams (daaaman64)
on 2008-08-26 20:31


Any ideas Robby?
Db33c374e79c9fe891c768e972143789?d=identicon&s=25 Victor Holtcamp (victorh)
on 2009-09-19 14:18
For anyone who happens across this searching for an answer (as I was)
the solution is to restart the server. Seemed to do the trick in my
case.
This topic is locked and can not be replied to.