# Mime::Types where?

**URL:** <https://www.ruby-forum.com/t/mime-types-where/146555>\
**Category:** Rails\
**Created:** [August 22, 2008, 10:10am UTC](https://www.ruby-forum.com/t/mime-types-where/146555 "2008-08-22T10:10:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 22, 2008, 10:10am UTC](https://www.ruby-forum.com/t/mime-types-where/146555/1 "2008-08-22T10:10:33Z")

</div>

I tried to use the Mime::Types in Ruby for my file upload. I added  
require ‘mime/types’ but it says “no such file to load”. Is it a gem or  
what? Something I should install?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 22, 2008, 10:37am UTC](https://www.ruby-forum.com/t/mime-types-where/146555/2 "2008-08-22T10:37:06Z")

</div>

Peter De Berdt wrote:

> On 22 Aug 2008, at 10:10, PÃ¥l BergstrÃ¶m wrote:

> Yes, or if you use Rails 2.1, you can add this to the gem section of  
> your environment.rb:
> 
> config.gem “mime-types”, :lib =\> “mime/types”, :version =\> ‘\>= 1’
> 
> and then run
> 
> rake gems:install
> 
> Best regards
> 
> Peter De Berdt

Thanks. That explains it. 🙂

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 22, 2008, 10:29am UTC](https://www.ruby-forum.com/t/mime-types-where/146555/3 "2008-08-22T10:29:20Z")

</div>

On 22 Aug 2008, at 10:10, PÃ¥l BergstrÃ¶m wrote:

> I tried to use the Mime::Types in Ruby for my file upload. I added  
> require ‘mime/types’ but it says “no such file to load”. Is it a gem  
> or  
> what? Something I should install?

Yes, or if you use Rails 2.1, you can add this to the gem section of  
your environment.rb:

config.gem “mime-types”, :lib =\> “mime/types”, :version =\> ‘\>= 1’

and then run

rake gems:install

Best regards

Peter De Berdt
