我有一个使用Better Errors的Rails应用程序,但错误页面不会加载binding_of_caller交互式shell(REPL)。相反,它仍然只是显示:
Tip: add gem "binding_of_caller" to your Gemfile to enable the REPL and local/instance variable inspection.
我的Gemfile有:
group :development, :test do
gem 'debugger'
gem 'better_errors'
gem 'binding_of_caller' #, :platforms=>[:mri_19, :mri_20, :rbx]
我尝试的最后一部分是评论或取消注释。在Rails控制台中尝试“require'binding_of_caller'”时,它返回false而不是错误,这意味着它已正确加载。 Gemfile.lock显示以下版本:
rails (4.1.0.rc2)
better_errors (1.1.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
可能有什么问题?我应该提供哪些其他代码来找出出错的线索?
答案 0 :(得分:0)
检查是否:
config.consider_all_requests_local = true
在config / environments / development.rb
中设置此外,如果您使用的是崇高编辑器,则可以添加:
BetterErrors.editor = :sublime if defined? BetterErrors
通过命名文件“better_errors.rb”在config / initializers文件夹中
请告诉我这是否有帮助?