How to disable explicit stack traces on Ruby on Rails website
Asked Answered
C

1

5

I have a Ruby on Rails Spree commerce app where I have explicit stack traces enabled in production (e.g., instead of the "We're sorry but something went wrong" message there is a long stack trace with developer-friendly and user unfriendly information).

I remember that I activated this to see what went wrong in production, but now I want to disable it again. Unfortunately I cannot find nor remember how to do this.

I hope someone can tell me how to configure my app to redirect to the standard 500 and 404 pages.

Colure answered 11/2, 2014 at 19:8 Comment(0)
U
9

Open project_root/config/environments/production.rb And set config.consider_all_requests_local = false

Unman answered 11/2, 2014 at 19:19 Comment(2)
Thanks that was it! Can I also do this on the server (via Rails Console)? Do not want to do a full deploy.Colure
I have never tried this before so I am not sure if it works, but you can try typing this into the console: Rails.configuration.consider_all_requests_local = falseUnman

© 2022 - 2024 — McMap. All rights reserved.