ruby-on-rails - 无法访问生产中的日志文件

标签 ruby-on-rails logging ubuntu permissions production

我试图运行我的应用程序并检查 production.log 上的一些输出。然而Ruby on Rails抛出此错误。
Apache 日志
Rails Error: Unable to access log file. Please ensure that /var/www/somefolder/someapp/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
我已经执行了必要的 chmod 666 production.log 以使其工作,但我意识到该文件处于 root 访问权限下。

所以我的文件权限是
-rw-rw-rw- 1 root root 20845 2010-03-18 01:18 production.log
我不确定如何允许 Ruby on Rails 访问此文件。我对管理 Linux 生产环境还很陌生,所以我请求您原谅我的无知。

最佳答案

我认为您需要将 production.log 的用户和组更改为 Rails 下运行的任何用户和组(即,Passenger 或 Mongrel 或任何您使用的)。

关于ruby-on-rails - 无法访问生产中的日志文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2469059/

相关文章:

linux - 在终端中运行 "source ~/.profile"之前,RVM 无法识别

javascript - jQuery 无限滚动、kaminari 和 Rails 4。在另一个页面上触发无限滚动。刷新后不行

google-chrome - Chrome 控制台表添加颜色

tomcat - 如何让更多登录tomcat

python - 从Google Cloud Run执行记录的最简单方法

linux - 使用 xdgutils 在 Ubuntu 中创建文件关联图标

c++ - tinyxml 如何在多个 xml 文件时使用它?

ruby-on-rails - 使用 Sanitize 将转换器中的节点列入白名单

ruby-on-rails - Rails 4 路由 : using namespaces with dynamic segments

ruby-on-rails - Rails - 使用 JSON 从 Controller 返回带有对象的附加属性