blog.sowatchasayin

Rails etc.

Rails 2.x.xでException Notifierが動かない時

Rails2.3.5アプリにException Notifierを入れました。

$ script/plugin install http://github.com/rails/exception_notification

諸々設定して起動したのですがこんなエラーが。
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant ApplicationController::ExceptionNotifiable (NameError)



調べてみると、Exception NotifierがRails 3に移行している影響みたいです。
Missing ExceptionNotifiable module with exception_notification plugin

なので、3系対応開始前のコミットを使えとのこと。特定のコミットを使うにはscript/pluginじゃないでgit submoduleを使います。
Git clone vs Git submodule
これで一つのリポジトリの中に他のリポジトリが持てます(言い方合ってますかね)。

素直にやってみます。

$ git submodule add git://github.com/rails/exception_notification.git vendor/plugins/exception_notification
$ cd vendor/plugins/exception_notification
$ git checkout -b rails2 e8b603e523c14f145da7b3a1729f5cc06eba2dd1
$ script/server -e production
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
** Erubis 2.6.5
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-01-29 17:56:33] INFO WEBrick 1.3.1
[2010-01-29 17:56:33] INFO ruby 1.8.7 (2009-06-12) [i486-linux]

動いた♪

No comments:

Post a Comment

Author

Fujimura Daisuke
http://fujimuradaisuke.com

Labels