回形针与铁轨

时间:2014-02-04 02:07:08

标签: ruby-on-rails paperclip

我正在使用papclip-ffmpeg gem来允许用户上传视频,我安装了gem并在我的用户模型中运行了快速启动代码。 class User<的ActiveRecord ::基

 # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,

             :recoverable, :rememberable, :trackable, :validatable
    def
             has_many :pins
             validates :name, presence: true
             has_attached_file :video, :styles => {
                    :medium => { :geometry => "640x480", :format => 'flv' },
                    :thumb => { :geometry => "100x100#", :format => 'jpg', :time => 10 }
                    }, :processors => [:ffmpeg]
    end

但这会将上传页面中的错误呈现为

Image There was an error processing the thumbnail for ob2-xvid-d0h-sample20140204-698-19dg2ms

任何想法都会非常感谢。

1 个答案:

答案 0 :(得分:1)

您遇到的问题是在生成缩略图时,您的系统中是否安装了ImageMagick?

于Debian / Ubuntu

sudo apt-get install imagemagick

MacOSX的

brew install imagemagick

要显示您的视频,您可以使用:

<%= video_tag pin.video.url(:medium), :size => "320x240", :controls => true %>
相关问题