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

我的生产环境是: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"