Ruby on Rails:在哪里可以获得错误日志?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17463654/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 22:17:10  来源:igfitidea点击:

Ruby on Rails : Where i can get error log?

ruby-on-rails

提问by AviSingh Rajput

I am new in ruby on rails. When ever something is wrong I got this error:

我是 ruby​​ on rails 的新手。每当出现问题时,我都会收到此错误:

Template is missing

Missing template errors/error_404 with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. 
Searched in: * "C:/Users/Avi/Documents/Aptana Studio 3 Workspace/social/app/views" * "C:/RubyonRails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/app/views" 

But the problem is something syntax error or programming error.

但问题是语法错误或编程错误。

Can I get a error log, something like in cakephp?

我可以得到一个错误日志,比如 cakephp 吗?

回答by phoet

like @thomas-klemm already wrote, you can tail the files in log. those logs are named after the environment you are running (development locally, production for live etc).

就像@thomas-klemm 已经写过的那样,你可以在日志中拖尾文件。这些日志以您正在运行的环境命名(本地开发、实时生产等)。

if you want to get all the output you can do a tail log/*

如果你想获得所有的输出,你可以做一个 tail log/*

from what i know, cakephp has a really nice application monitoring and administration backend. if you want something similar for rails, you can use better_errors: https://github.com/charliesome/better_errors

据我所知,cakephp 有一个非常好的应用程序监控和管理后端。如果你想要类似 rails 的东西,你可以使用 better_errors:https: //github.com/charliesome/better_errors

回答by Chaithanya Krishna

Open your rails application. You will find a directory named log. Open it then you will find a log file named development. It is the file where are the errors are logged.

打开您的 Rails 应用程序。您将找到一个名为log的目录。打开它,你会发现一个名为development的日志文件。它是记录错误的文件。