Gem 'better_errors' 不工作 Rails 5.0.0

Gem 'better_errors' not working Rails 5.0.0

我在 rails 应用程序上为我的 ruby 安装了 gem better_errors 版本 2.1.1。但是,我仍然得到相同的旧调试页面。我还安装了 gem binding_of_caller。我什至安装了三个 gem,它们显示为 better_errors 的运行时依赖项,即 erubiscoderayrack(请参阅 gem页 here)。这一切都无济于事。

我也尝试过其他解决方案,一种是this。这一切都无济于事。

我正在使用 Ubuntu 16.04rails 5.0.0.1ruby 2.3.1p112

确保您没有仅使用 routing error / 404 exception, as that will no longer end up triggering better_errors.

进行测试

确认它是否有效的最佳方法是在控制器操作中放置一些未定义的变量,然后点击它 URL。

您在开发中安装了 gem?

'group :development do
  gem "better_errors"
end'

我刚刚将 better_errors 添加到我的 Rails 5 应用程序并且它工作正常。