我的Rails应用程序突然变为只读

时间:2015-10-13 05:00:48

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

我正在使用我的rails应用程序,离开它一段时间,回来了,并试图重新启动我的服务器。作为回应,我收回了这个错误:

$http({
    method: 'GET',
    url: myRestApiUri
})
.then(
    function successCallback( response ) {
        handlers.success(response);
    },
    function errorCallback( response  ) {
        if( response.status === 404 ) {
            handlers.success( [] );
        }
        else {
            handlers.error(response);
        }
    }
)

我不知道我能做些什么导致这个。我从来没有碰过我的日志目录。我尝试运行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命令,例如chmod 0666 /home/user/app/log/development.logchmod 0664。每次我回来时:

chmod 777

但我总是从chmod: changing permissions of ‘/home/user/app/log/development.log’: Read-only file system 收到同样的错误。

然后我放弃并切换到我正在处理的其他应用,但在为该应用运行rails s后,我基本上得到了同样的错误:

rails s

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

更新

正在运行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. 让我回复:

sudo chmod 777 -R log

1 个答案:

答案 0 :(得分:0)

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

我希望这可以帮到你!