heroku 上的视频有问题

发布于 2024-08-25 23:54:58 字数 6497 浏览 5 评论 0原文

我最近将我的 RoR 应用程序移到了 Heroku 平台上,几乎 除了视频之外一切都很好。当我的应用程序运行良好时 在本地运行但不在heroku 上运行。这是我收到的错误日志,如果 谁知道它来自哪里:

Processing VideosController#new (for IP at 2010-03-20 04:32:09) [GET] 
  Session ID: 6abecf60c3369d7c7029e366bb801e08 
  Parameters: {"artist_id"=>"10", "action"=>"new", 
"controller"=>"admin/videos"} 
Rendering  within layouts/admin 
Rendering admin/videos/new 
ActionView::TemplateError (undefined method `video_file_relative_path' 
for #<Video:0x2adc9839fe28>) on line #21 of app/views/admin/videos/ 
_form.rhtml: 
18: 
19: <p><label for="videos_image_file">Fichier Vidéo SWF</label><br/> 
20: <% if @video.video_file %> 
21:             <%=  link_to image_tag(url_for_file_column("video", 
"video_file", :name => "thumbnail"))+"<br>", {:controller => 
url_for_file_column("video", "video_file")}, :popup => ['new_window', 
'height=200,width=200'] %> 
22: <% end %> 
23: <%= file_column_field 'video', 'video_file'  %> 
24: &nbsp;&nbsp;&nbsp; 
    #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb: 
1792:in `method_missing' 
    #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column_helper.rb: 
75:in `send' 
    #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column_helper.rb: 
75:in `url_for_file_column' 
    #{RAILS_ROOT}/app/views/admin/videos/_form.rhtml:21:in 
`_run_rhtml_admin_videos__form' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `send' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `compile_and_render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
290:in `render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
249:in `render_file' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
264:in `render' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
59:in `render_partial' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:33:in `benchmark' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
58:in `render_partial' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
276:in `render' 
    #{RAILS_ROOT}/app/views/admin/videos/new.rhtml:4:in 
`_run_rhtml_admin_videos_new' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `send' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `compile_and_render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
290:in `render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
249:in `render_file' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:699:in `render_file' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:621:in `render_with_no_layout' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
layout.rb:243:in `render_without_benchmark' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:53:in `render' 
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:53:in `render' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:911:in `perform_action_without_filters' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:368:in `perform_action_without_benchmark' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:69:in `perform_action_without_rescue' 
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:69:in `perform_action_without_rescue' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
rescue.rb:82:in `perform_action' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:381:in `send' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:381:in `process_without_filters' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:377:in `process_without_session_management_support' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
session_management.rb:117:in `process' 
    #{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:38:in 
`dispatch' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/rack/adapter/ 
rails.rb:60:in `serve_rails' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/rack/adapter/ 
rails.rb:80:in `call' 
    /home/heroku_rack/lib/static_assets.rb:9:in `call' 
    /home/heroku_rack/lib/last_access.rb:25:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb: 
46:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb: 
40:in `each' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb: 
40:in `call' 
    /home/heroku_rack/lib/date_header.rb:14:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb: 
60:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:80:in `pre_process' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:78:in `catch' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:78:in `pre_process' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:57:in `process' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:42:in `receive_data' 
    /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.6/lib/ 
eventmachine.rb:240:in `run_machine' 
    /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.6/lib/ 
eventmachine.rb:240:in `run' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/backends/ 
base.rb:57:in `start' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/server.rb: 
150:in `start' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/controllers/ 
controller.rb:80:in `start' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/runner.rb: 
173:in `send' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/runner.rb: 
173:in `run_command' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/runner.rb: 
139:in `run!' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/bin/thin:6 
    /usr/local/bin/thin:20:in `load' 
    /usr/local/bin/thin:20 

谢谢

I have recently moved my RoR app on the Heroku platform, and almost
everything works fine apart from the videos. It works fine when my app
runs in local but not on heroku. This is the error log I'm getting, if
anyone knows where it can be coming from:

Processing VideosController#new (for IP at 2010-03-20 04:32:09) [GET] 
  Session ID: 6abecf60c3369d7c7029e366bb801e08 
  Parameters: {"artist_id"=>"10", "action"=>"new", 
"controller"=>"admin/videos"} 
Rendering  within layouts/admin 
Rendering admin/videos/new 
ActionView::TemplateError (undefined method `video_file_relative_path' 
for #<Video:0x2adc9839fe28>) on line #21 of app/views/admin/videos/ 
_form.rhtml: 
18: 
19: <p><label for="videos_image_file">Fichier Vidéo SWF</label><br/> 
20: <% if @video.video_file %> 
21:             <%=  link_to image_tag(url_for_file_column("video", 
"video_file", :name => "thumbnail"))+"<br>", {:controller => 
url_for_file_column("video", "video_file")}, :popup => ['new_window', 
'height=200,width=200'] %> 
22: <% end %> 
23: <%= file_column_field 'video', 'video_file'  %> 
24:     
    #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb: 
1792:in `method_missing' 
    #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column_helper.rb: 
75:in `send' 
    #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column_helper.rb: 
75:in `url_for_file_column' 
    #{RAILS_ROOT}/app/views/admin/videos/_form.rhtml:21:in 
`_run_rhtml_admin_videos__form' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `send' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `compile_and_render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
290:in `render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
249:in `render_file' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
264:in `render' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
59:in `render_partial' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:33:in `benchmark' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
58:in `render_partial' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
276:in `render' 
    #{RAILS_ROOT}/app/views/admin/videos/new.rhtml:4:in 
`_run_rhtml_admin_videos_new' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `send' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
314:in `compile_and_render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
290:in `render_template' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
249:in `render_file' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:699:in `render_file' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:621:in `render_with_no_layout' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
layout.rb:243:in `render_without_benchmark' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:53:in `render' 
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:53:in `render' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:911:in `perform_action_without_filters' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:368:in `perform_action_without_benchmark' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:69:in `perform_action_without_rescue' 
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:69:in `perform_action_without_rescue' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
rescue.rb:82:in `perform_action' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:381:in `send' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
base.rb:381:in `process_without_filters' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:377:in `process_without_session_management_support' 
    #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
session_management.rb:117:in `process' 
    #{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:38:in 
`dispatch' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/rack/adapter/ 
rails.rb:60:in `serve_rails' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/rack/adapter/ 
rails.rb:80:in `call' 
    /home/heroku_rack/lib/static_assets.rb:9:in `call' 
    /home/heroku_rack/lib/last_access.rb:25:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb: 
46:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb: 
40:in `each' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb: 
40:in `call' 
    /home/heroku_rack/lib/date_header.rb:14:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb: 
60:in `call' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:80:in `pre_process' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:78:in `catch' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:78:in `pre_process' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:57:in `process' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/ 
connection.rb:42:in `receive_data' 
    /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.6/lib/ 
eventmachine.rb:240:in `run_machine' 
    /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.6/lib/ 
eventmachine.rb:240:in `run' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/backends/ 
base.rb:57:in `start' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/server.rb: 
150:in `start' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/controllers/ 
controller.rb:80:in `start' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/runner.rb: 
173:in `send' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/runner.rb: 
173:in `run_command' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/lib/thin/runner.rb: 
139:in `run!' 
    /usr/local/lib/ruby/gems/1.8/gems/thin-1.0.1/bin/thin:6 
    /usr/local/bin/thin:20:in `load' 
    /usr/local/bin/thin:20 

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若相惜即相离 2024-09-01 23:54:58

看来您一定正在尝试编写一些与 Heroku 文件系统上的视频有关的内容。这不起作用,因为它是只读的。

您需要将视频以及当前在文件系统上创建的任何其他内容存储在其他位置 (Amazon S3效果很好)。

It looks like you must be trying to do something that writes something that has to do with the videos on the Heroku filesystem. This won't work because it's readonly.

You'll need to store your videos and anything else that currently gets created on the filesystem elsewhere (Amazon S3 works great).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文