2
2

More than 5 years have passed since last update.

Rack middlewareを一時的に外す比較的楽な方法

Last updated at Posted at 2014-01-15

公式に書いてあるのを参考に以下のようにする。

config/application.rb
    config.middleware.delete "ActionDispatch::DebugExceptions"

例外発生したときに、デバッグページを飛ばした処理が見たかったときに役立った。Production で起動するのが億劫なときに助かりそう。

追記

better_errors と合わせて使うと上手くいかなかった。better_errors がActionDispatch::DebugExceptions依存の処理を行っているため。
適当に config/initialize/xxx.rb みたいなのを作って、delete すると一先ずできた。

config/initializer/xxx.rb
    Rails.application.config.middleware.delete "ActionDispatch::DebugExceptions"
    Rails.application.config.middleware.delete "BetterErrors::Middleware"

SEE ALSO

公式: http://guides.rubyonrails.org/rails_on_rack.html

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2