简体   繁体   English

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

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

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

I have a Errno:EACCES Permission denied /system error when i try to upload a file with paperclip. 当我尝试使用回形针上传文件时,我有一个Errno:EACCES权限被拒绝/系统错误。 Useless to say that locally this doesn't happen. 没用,说本地不会发生这种情况。 I checked the public directory permissions and it's 775, the public/system permission is 777 as well as all it's inner directory. 我检查了公共目录权限,它是775,公共/系统权限是777以及它的所有内部目录。 The tmp directory permission is : 775 too. tmp目录权限是:775。 Moreover the user used to deploy the application is www-data:root 此外,用于部署应用程序的用户是www-data:root

The model's attachment is set like this : 模型的附件设置如下:

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

I can't find out why i get this error. 我无法找出为什么我得到这个错误。 Anyone has got an idea ? 有人有想法吗?

Thanks 谢谢

Your code DOES NOT try to save the uploaded file in: 您的代码不会尝试将上传的文件保存在:

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

but in: 但在:

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

Try this instead: 试试这个:

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