我正在使用refinerycms 1.0.9,我想更改蜻蜓保存文件的默认位置。
这是我在 config/initializers 中的dragonfly.rb:
require 'dragonfly'
app = Dragonfly[:app_name]
app.datastore = Dragonfly::DataStorage::FileDataStore.new
app.datastore.configure do |d|
d.root_path = '/Projects/images'
d.server_root = '/Projects'
d.store_meta = false
end
当我保存文件时,我收到以下错误:
Dragonfly::Shell::CommandFailed (Command failed (identify '/var/folders/5t/mf86p8gx6bz94dzfb88xpvpr0000gn/T/RackMultipart20120328-6943-1vbpa7u') with exit status 127):
更新
我重新安装了 imagemagick 并消除了错误,但是它仍然将文件保存到 /system/images.xml 。我尝试在炼油厂覆盖 Image 模型并添加:
image_accessor :image do
storage_path{ "/Projects/images/#{rand(100)}" }
end
但这也没有用。