2017-03-01 88 views
1

我有一个Filemanager应用程序,它不使用模型,也不在数据库中存储任何内容。因此,我必须以不同的方式进行设置。我的设置如下:Rails:找不到蜻蜓UID,虽然它正确显示路径

当生成的网址是正确生成的文件

files.each do |file| 
    filesObj = { 
     "name" => file, 
     "path" => File.expand_path(directory_name + '/' + file), 
     "modified" => File.ctime(directory_name + '/' + file), 
     "size" => (File.size(directory_name + '/' + file).to_f/2**20), 
     "url" => url + file, 
     "thumb_url" => 'http://' + request.host_with_port() + '/' + dragonfly.app.fetch(url_path + '/' + file).thumb('400x200').url 
     } 
end 

,一个这样的网址是:http://localhost:3000/media/W1siZiIsIi9tZWRpYS8xLkpQRyJdLFsicCIsInRodW1iIiwiNDAweDIwMCJdXQ?sha=051428e06f681fb2

当我去那个URL,我得到以下在终端中: Started GET "/media/W1siZiIsIi9tZWRpYS8xLkpQRyJdLFsicCIsInRodW1iIiwiNDAweDIwMCJdXQ?sha=051428e06f681fb2" for ::1 at 2017-03-01 12:57:58 -0500 DRAGONFLY: uid /media/1.JPG not found DRAGONFLY: GET /media/W1siZiIsIi9tZWRpYS8xLkpQRyJdLFsicCIsInRodW1iIiwiNDAweDIwMCJdXQ?sha=051428e06f681fb2 404

该文件存在于媒体文件夹中。任何想法为什么它失败?

回答

0

它失败有两个原因

  1. 我没有安装ImageMagick
  2. gem已过时,它寻找convert命令,其中ImageMagick从版本7.0中删除。