繁体   English   中英

Paperclip Errno :: EACCES(权限被拒绝 - /系统)

[英]Paperclip Errno::EACCES (Permission denied - /system)

我的生产环境是:ruby 1.9.2-p320,rails 3.2.7,paperclip 3.1.4,mysql,Ubuntu 8.10 x86 64bit。

当我尝试使用回形针上传文件时,我有一个Errno:EACCES权限被拒绝/系统错误。 没用,说本地不会发生这种情况。 我检查了公共目录权限,它是775,公共/系统权限是777以及它的所有内部目录。 tmp目录权限是:775。 此外,用于部署应用程序的用户是www-data:root

模型的附件设置如下:

has_attached_file :fichier,
        :path => "/system/:attachment/:id/:style/:filename",
        :url => "/system/:attachment/:id/:style/:filename"

我无法找出为什么我得到这个错误。 有人有想法吗?

谢谢

您的代码不会尝试将上传的文件保存在:

/path/to/app/public/system/:attachment/:id/:style/:filename

但在:

/system/:attachment/:id/:style/:filename

试试这个:

has_attached_file :fichier,
    :path => ":rails_root/public/system/:attachment/:id/:style/:filename",
    :url => "/system/:attachment/:id/:style/:filename"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM