# Cant serve video via rails

**URL:** <https://www.ruby-forum.com/t/cant-serve-video-via-rails/152622>\
**Category:** Rails\
**Created:** [November 5, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/cant-serve-video-via-rails/152622 "2008-11-05T18:38:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fox](https://www.ruby-forum.com/u/fox)\
**Post date:** [November 5, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/cant-serve-video-via-rails/152622/1 "2008-11-05T18:38:37Z")

</div>

Hi all,  
I have an m4v file which I’m trying to view on my iPhone via a rails  
app.  
If i place the file in my apache root or in /public and hit the url, it  
plays back fine, but no matter what I try with rails, the iPhone will  
try to download the file and receive an error.

I have set up an apache-\>mongrel balanced cluster, with the rails  
/public directory being handled by apache  
config here: [http://pastebin.ca/1245995](http://pastebin.ca/1245995)

I’ve tried adding a mime-type to config/initializers/mime\_types.rb like  
this:  
Mime::Type.register “video/m4v”, :m4v  
but that made no difference.

Any ideas where i’m going wrong? Shouldn’t the apache server be serving  
the static content given my config?

according to this post Directory directives are recursive, so should  
apply to files in RAILS\_ROOT/public/files/\*  
[http://mail-archives.apache.org/mod\_mbox/httpd-wiki-changes/200702.mbox/removed\_email\_address@domain.invalid\>](http://mail-archives.apache.org/mod_mbox/httpd-wiki-changes/200702.mbox/removed_email_address@domain.invalid%3E)

the files i’m linking to are like: [http://localhost/files/video.m4v](http://localhost/files/video.m4v)

thanks for reading

---

<div class="post-metadata">

**Author:** ![fox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fox](https://www.ruby-forum.com/u/fox)\
**Post date:** [November 5, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/cant-serve-video-via-rails/152622/2 "2008-11-05T22:47:18Z")

</div>

On 5 Nov 2008, at 17:38, Oliver F. wrote:

> /public directory being handled by apache  
> config here: [http://pastebin.ca/1245995](http://pastebin.ca/1245995)

shouldn’t your document root be /home/devel/Projects/demosite/branches/  
demosite/public ?

that’s the way it normally is with an apache deployment (if not the /  
some\_video.m4v would indeed get passed to rails)

Fred
