2012-09-24 126 views
2

回形针2.7 的Ruby 1.8.7企业 的Rails 3.1.0 ImageMagick的6.6回形针 - 无路由匹配GET

当我上传的图像即时通讯我的应用程序,它们被正确地处理的ImageMagick和它们存储在conrrectly路径。但是,当我需要拿这个文件来显示,没有找到。

保存图像:

Started POST "/p" for 177.16.57.105 at Sun Sep 23 23:39:16 -0300 2012 
Processing by ProductsController#create as HTML 
Parameters: {"commit"=>"Salvar", "authenticity_token"=>"EgBUGfKIIduS2lkl0mh5p27pT0vF0/P8HXO852KHMM8=", "utf8"=>"â", "product"=>{"photo"=>#>, "price"=>"", "name"=>"Brigadeiro de pistache", "product_type"=>"1", "featured"=>"0", "description"=>"Brigadeiro de pistache"}} 
[32mCommand[0m :: convert '/tmp/stream20120923-19588-vw8u1s-020120923-19588-3lym39-0[0]' -resize "120x80>" '/tmp/stream20120923-19588-vw8u1s-020120923-19588-3lym39-020120923-19588-16ky3i8-0' 
[paperclip] Saving attachments. 
[paperclip] saving /home/brigaderiagourmand/apps_rails/site/public/system/photos/24/short/brigadeirocolorido.png 
Redirected to http://brigaderiagourmand.com.br/p/24 
Completed 302 Found in 257ms 

当我需要把文件...

Started GET "/photos/original/missing.png" for 177.16.57.105 at Sun Sep 23 23:39:17 -0300 2012 

ActionController::RoutingError (No route matches [GET] "/photos/original/missing.png"): 

我的模型

class Product < ActiveRecord::Base 
    attr_accessible :name, :description, :price, :photo, :product_type, :featured 
    attr_accessor :photo_file_name 
    has_attached_file :photo, :styles => { :thumb => "50x50>", :medium => "280x180>", :large => "585x400>", :short => "120x80>", :original => "200,200>" } 

    TYPES = ["Belga", "Normal"] 
end 

点表意见

= form_for @product, :html => {:multipart => true} do |f| 
    = f.file_field :photo 

显示视图

= image_tag @product.photo.url(:original) 
+0

您可以发布您的路线? –

回答

0

是从处理图像完整的输出? 在您的输出回形针只重新大小为短(120x80>)

您的获取请求正尝试加载missing.jpg,如果找不到请求,则这是图像的默认设置。看看/ home/brigaderiagourmand/apps_rails/site/public/system/photos/24 /并查看是否有其他重新尺寸的照片。

有来自瑞安贝茨一个伟大的截屏约paperclip

希望这有助于你

+0

谢谢@Flo,但我迁移到carrierwave :) – Ronan

相关问题