tmp 中的权限被拒绝 [英] Permission denied in tmp

查看:98
本文介绍了tmp 中的权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用 Ruby 1.9.2 部署了一个 Rails 3 应用程序.我遇到了几个错误.

I just deployed a Rails 3 app with Ruby 1.9.2. I have been getting several errors.

  1. application.css 未编译.所以我将 production.rb 中的预编译设置为 false;
  2. 然后我得到:cannot generate tempfile,所以我做了rake tmp:clear;
  3. 现在我收到 ActionView::Template::Error (Permission denied -/srv/www/appname/tmp/cache/assets): 并且我无法解决这个问题.
  1. application.css wasn't compiled. so I set pre compilation in production.rb to false;
  2. Then I got: cannot generate tempfile, so I did rake tmp:clear;
  3. And now I get ActionView::Template::Error (Permission denied - /srv/www/appname/tmp/cache/assets): and I haven't been able to fix this one.

请帮忙.

推荐答案

如果运行您的 Web 服务器的 user:grouphttp:http 并且它在 *nix 上运行,这样做:

If the user:group running your web server is http:http and it's running on *nix, do this:

sudo chown -R http:http /srv/www/appname/

还有,愚蠢的问题,但是/tmp/cache/assets 存在吗?

Also, silly question, but does /tmp/cache/assets exist?

如果是这样,正如 @leonel 指出的那样,您可能还需要更改权限:

And, if so, as @leonel points out, you may also need to change the permissions:

chmod 777 /srv/www/appname/tmp/cache

小心设置777权限.这样做只是为了验证权限问题,然后重置为所需的最低权限.

Be careful setting 777 permissions on anything. Only do this to verify a permissions issue, then reset to the most minimal permissions necessary.

这篇关于tmp 中的权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆