我试图运行我的应用程序并检查 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/