【问题标题】:My Rails apps all suddenly became read-only我的 Rails 应用突然变成了只读的
【发布时间】:2016-01-10 17:16:40
【问题描述】:

我正在开发我的 Rails 应用程序,将其放置了一段时间,然后回来并尝试重新启动我的服务器。作为回应,我得到了这个错误:

Rails Error: Unable to access log file. Please ensure that /home/user/app/log/development.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 0666 /home/user/app/log/development.log,然后运行其他各种chmod 命令,例如chmod 0664chmod 777。每次回来:

chmod: changing permissions of ‘/home/user/app/log/development.log’: Read-only file system

但我总是从rails s 得到同样的错误。

然后我放弃并切换到我正在开发的另一个应用程序,但在为该应用程序运行 rails s 后,我得到了基本相同的错误:

Rails Error: Unable to access log file. Please ensure that /home/user/sweat/log/development.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.

发生了什么事?我使用的是 Ubuntu 14.04。

更新

运行sudo chmod 777 -R log 会返回这个:

sudo: unable to open /var/lib/sudo/user/1: No such file or directory
chmod: changing permissions of ‘log’: Read-only file system
chmod: changing permissions of ‘log/development.log’: Read-only file system
chmod: changing permissions of ‘log/.keep’: Read-only file system

【问题讨论】:

  • 听起来您缺少 /log 目录...该文件确实存在吗?
  • @BradWerth 是的,这两个应用程序都有 /log/development.log 文件。

标签: ruby-on-rails linux ubuntu permissions chmod


【解决方案1】:

如果您使用的是 Linux! 试试这个 => cd home/user/app 然后 => sudo chmod 777 -R log

希望对你有帮助!

【讨论】:

  • 我运行了这个,但我得到了一个错误,我将它添加到我的问题中。
  • 你在终端打开了应用目录吗?
  • 哦,我明白你在说什么。是的,我在正确的目录中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多