heroku 回形针视频错误 Av::UnableToDetect无法检测到任何支持的库:

问题描述

我正在尝试使用回形针将视频上传到我的网站,它在本地运行良好,但在 heroku 中出现此错误

 ActionController::RoutingError (No route matches [GET] "/videos/original/missing.png"):
2021-01-06T19:53:12.425050+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/actionpack-4.2.11.1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2021-01-06T19:53:12.425050+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/actionpack-4.2.11.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2021-01-06T19:53:12.425050+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/railties-4.2.11.1/lib/rails/rack/logger.rb:38:in `call_app'
2021-01-06T19:53:12.425052+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/railties-4.2.11.1/lib/rails/rack/logger.rb:20:in `block in call'
2021-01-06T19:53:12.425052+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.11.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2021-01-06T19:53:12.425052+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.11.1/lib/active_support/tagged_logging.rb:26:in `tagged'
2021-01-06T19:53:12.425053+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.11.1/lib/active_support/tagged_logging.rb:68:in `tagged'
2021-01-06T19:53:12.425053+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/railties-4.2.11.1/lib/rails/rack/logger.rb:20:in `call'
2021-01-06T19:53:12.425053+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/actionpack-4.2.11.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2021-01-06T19:53:12.425054+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/rack-1.6.13/lib/rack/methodoverride.rb:22:in `call'
2021-01-06T19:53:12.425055+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/rack-1.6.13/lib/rack/runtime.rb:18:in `call'
2021-01-06T19:53:12.425055+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.11.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
2021-01-06T19:53:12.425055+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/actionpack-4.2.11.1/lib/action_dispatch/middleware/static.rb:120:in `call'
2021-01-06T19:53:12.425056+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/rack-1.6.13/lib/rack/sendfile.rb:113:in `call'
2021-01-06T19:53:12.425057+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/actionpack-4.2.11.1/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2021-01-06T19:53:12.425057+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/railties-4.2.11.1/lib/rails/engine.rb:518:in `call'
2021-01-06T19:53:12.425061+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/railties-4.2.11.1/lib/rails/application.rb:165:in `call'
2021-01-06T19:53:12.425061+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/rack-1.6.13/lib/rack/content_length.rb:15:in `call'
2021-01-06T19:53:12.425061+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/puma-5.1.1/lib/puma/configuration.rb:246:in `call'
2021-01-06T19:53:12.425062+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/puma-5.1.1/lib/puma/request.rb:76:in `block in handle_request'
2021-01-06T19:53:12.425062+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/puma-5.1.1/lib/puma/thread_pool.rb:337:in `with_force_shutdown'
2021-01-06T19:53:12.425062+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/puma-5.1.1/lib/puma/request.rb:75:in `handle_request'
2021-01-06T19:53:12.425063+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/puma-5.1.1/lib/puma/server.rb:431:in `process_client'
2021-01-06T19:53:12.425063+00:00 app[web.1]: vendor/bundle/ruby/2.6.0/gems/puma-5.1.1/lib/puma/thread_pool.rb:145:in `block in spawn_thread'
2021-01-06T19:53:12.425063+00:00 app[web.1]: 
2021-01-06T19:53:12.425064+00:00 app[web.1]: 
2021-01-06T19:53:12.458808+00:00 heroku[router]: at=info method=GET path="/videos/original/missing.png" host=www.mobileimplantlab.ca request_id=a7661465-ee4e-49d4-b694-27814e4fb23b fwd="24.85.18.207" dyno=web.1 connect=0ms service=71ms status=404 bytes=222 protocol=https
2021-01-06T19:53:30.751932+00:00 app[web.1]: Started POST "/galleries" for 24.85.18.207 at 2021-01-06 19:53:30 +0000
2021-01-06T19:53:30.768629+00:00 app[web.1]: Processing by galleriesController#create as HTML
2021-01-06T19:53:30.768802+00:00 app[web.1]: Parameters: {"utf8"=>"✓","authenticity_token"=>"YFGiYYWmgDb+foSNMk1u1o2H2bp11nqwjAVzc4jqeGYDxoG6zLNGyFxBMvUrqxhBUAt+pex21VI+NqRGucRGOQ==","gallery"=>{"product_name"=>"","title1"=>"","title2"=>"","title3"=>"","title4"=>"","title5"=>"","videotitle"=>"","video"=>#<Actiondispatch::Http::UploadedFile:0x000055ebb2b89770 @tempfile=#<Tempfile:/tmp/RackMultipart20210106-4-baa646.mp4>,@original_filename="IMG_2826.mp4",@content_type="video/mp4",@headers="Content-disposition: form-data; name=\"gallery[video]\"; filename=\"IMG_2826.mp4\"\r\nContent-Type: video/mp4\r\n">},"commit"=>"Submit"}
2021-01-06T19:53:30.790290+00:00 app[web.1]: User Load (5.8ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["id",1]]
2021-01-06T19:53:30.836411+00:00 app[web.1]: [paperclip] Trying to link /tmp/RackMultipart20210106-4-baa646.mp4 to /tmp/847606d3771b12aa2d91db7647fe3a4920210106-4-1m2r6hc.mp4
2021-01-06T19:53:30.844138+00:00 app[web.1]: [paperclip] Trying to link /tmp/847606d3771b12aa2d91db7647fe3a4920210106-4-1m2r6hc.mp4 to /tmp/847606d3771b12aa2d91db7647fe3a4920210106-4-fg47sn.mp4
2021-01-06T19:53:30.858332+00:00 app[web.1]: Command :: file -b --mime '/tmp/847606d3771b12aa2d91db7647fe3a4920210106-4-fg47sn.mp4'
2021-01-06T19:53:30.938505+00:00 app[web.1]: [AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
2021-01-06T19:53:30.960650+00:00 app[web.1]: [AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
2021-01-06T19:53:30.973770+00:00 app[web.1]: Completed 500 Internal Server Error in 204ms (ActiveRecord: 14.0ms)
2021-01-06T19:53:30.975178+00:00 app[web.1]: 
2021-01-06T19:53:30.975180+00:00 app[web.1]: Av::UnabletoDetect (Unable to detect any supported library):
2021-01-06T19:53:30.975180+00:00 app[web.1]: app/controllers/galleries_controller.rb:8:in `create

这是我的模型

class gallery < ActiveRecord::Base
  has_attached_file :image1,:styles => { :medium => "300x300>",:thumb => "100x100>" },:default_url => "/images/:style/missing.png"
  validates_attachment_content_type :image1,:content_type => /\aimage\/.*\Z/
  has_attached_file :image2,:default_url => "/images/:style/missing.png"
  validates_attachment_content_type :image2,:content_type => /\aimage\/.*\Z/
  has_attached_file :image3,:default_url => "/images/:style/missing.png"
  validates_attachment_content_type :image3,:content_type => /\aimage\/.*\Z/
  has_attached_file :image4,:default_url => "/images/:style/missing.png"
  validates_attachment_content_type :image4,:content_type => /\aimage\/.*\Z/
  has_attached_file :image5,:default_url => "/images/:style/missing.png"
  validates_attachment_content_type :image5,:content_type => /\aimage\/.*\Z/
  has_attached_file :video,:styles => {
     :medium => { :geometry => "500x500",:format => 'jpg' },:thumb => { :geometry => "100x100",:format => 'jpg' }
  },:processors => [:transcoder]

validates_attachment_content_type :video,:content_type => [
      "video/mp4","video/quicktime","video/3gpp","video/x-ms-wmv","video/mov","video/flv",],:message => "Sorry! We do not accept the attached file type"

end

我有这些宝石

gem "paperclip"
gem 'paperclip-av-transcoder'
gem "paperclip-ffmpeg","~> 1.2.0"

我对这个问题做了很少的研究,它说我必须将它添加到我的 heroku buildpack 中,但是当我添加它时,我的 heroku 网站崩溃了。所以我删除它。还有其他解决方案吗? https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git

提前致谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...