加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – ExceptionNotifier.notify_exception无法正常

发布时间:2020-12-17 03:36:51 所属栏目:百科 来源:网络整理
导读:我们正在使用这个gem( https://github.com/smartinez87/exception_notification)和rails 3.2.11.我们想从控制器的动作和wikie中提到的后台进程使用以下方法“ExceptionNotifier.notify_exception(e)”但是我们得到以下错误 ExceptionNotifier的未定义方法`no
我们正在使用这个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.

谢谢

解决方法

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

你可以将你的Gemfile指向git repo

gem "exception_notification",git: "git://github.com/smartinez87/exception_notification.git"

或使用适当的API调用3.0.1

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

3.0.1的文档是here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读