ExceptionNotifier.notify_exception无法正常工作

jun*_*lik 5 ruby-on-rails exception-notification

我们正在使用这个gem(https://github.com/smartinez87/exception_notification)和rails 3.2.11.我们想从控制器的动作和wikie中提到的后台进程使用以下方法"ExceptionNotifier.notify_exception(e)"但是我们得到以下错误

ExceptionNotifier的未定义方法`notify_exception':Class

我们正在安装这个gem的3.0.1版本.gem"exception_notification","〜> 3.0.1"

我们的rails版本是3.2.11,ruby版本是ruby 1.9.2p320.

谢谢

dee*_*our 6

您正在阅读notify_exception尚未作为gem发布的版本的API .

你可以指向你Gemfile的git repo

gem "exception_notification", git: "git://github.com/smartinez87/exception_notification.git"
Run Code Online (Sandbox Code Playgroud)

或使用适当的API调用 3.0.1

ExceptionNotifier::Notifier.exception_notification(request.env, exception,
:data => {:message => "was doing something wrong"}).deliver
Run Code Online (Sandbox Code Playgroud)

文档就3.0.1这里.

  • 为了公平对待OP,直到创建这个问题差不多一个星期之后,在README中添加了任何类似有用的东西.https://github.com/smartinez87/exception_notification/commits/master/README.md似乎你是唯一一个遇到麻烦的人:-) (2认同)