1

我正在用 Rails 3.0.11 和 MiniMagick 写一个小照片库。

def JadeImage.rescale path,new_path,max_height=150
    image = MiniMagick::Image.open(path)
    image.adaptive_resize(self.resize(image[:height],max_height))if image[:height] > max_height
    image.write(new_path)
  end

我正在使用它从同一张照片中保存两个调整大小的图像。其中一个文件以 644 权限保存,一切正常。另一个总是保存为 600,因此无法在网页中显示。

现在,在保存它们之后,我运行一个小实用程序将该目录中的所有内容设置为 644,这样它现在就可以工作了。

有什么理由会发生这种情况吗?

4

1 回答 1

1

这就是我最终解决此问题的方法。如果您使用的是 apache,请尝试添加到您的 apache2.conf

PassengerUserSwitching Off
PassengerDefaultUser www-data   
PassengerDefaultGroup www-data
于 2012-02-22T20:05:05.123 回答