【发布时间】:2012-04-12 04:26:15
【问题描述】:
我使用的是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.我尝试在炼油厂覆盖 Image 模型并添加:
image_accessor :image do
storage_path{ "/Projects/images/#{rand(100)}" }
end
但这也没有用。
【问题讨论】:
标签: ruby-on-rails-3 refinerycms dragonfly-gem