可卡因:: CommandNotFoundError

时间:2015-11-19 10:21:45

标签: ruby-on-rails ffmpeg paperclip

使用paperclip-ffmpeg进行视频上传。

当我上传时会出错

Cocaine::CommandNotFoundError (Cocaine::CommandNotFoundError):
app/controllers/ads_controller.rb:27:in `create

Cannot render console with content type multipart/form-dataAllowed content types: [#<Mime::Type:0x000000035c5bb8 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">, #<Mime::Type:0x000000035c57f8 @synonyms=[], @symbol=:text, @string="text/plain">, #<Mime::Type:0x000000035b06a0 @synonyms=[], @symbol=:url_encoded_form, @string="application/x-www-form-urlencoded">]

我的模特是

has_attached_file :videod, :styles => { 
  :medium => { :geometry => "640x480", :format => 'flv' },
  :thumb => { :geometry => "100x100#", :format => 'jpg', :time => 10 }
}, :processors => [:ffmpeg]
validates_attachment_size :videod, :less_than => 100.megabytes
validates_attachment_presence :videod
validates_attachment_content_type :videod, :content_type => /\Avideo\/.*\Z/

我的Gemfile是

gem "cocaine"
gem 'paperclip-ffmpeg'

1 个答案:

答案 0 :(得分:1)

问题是我没有在本地安装ffmpeg

sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
sudo apt-get update
sudo apt-get install ffmpeg

之后就可以了。