# Question About Gems And DataBase's?

**URL:** <https://www.ruby-forum.com/t/question-about-gems-and-databases/147183>\
**Category:** Rails\
**Created:** [August 29, 2008, 5:52am UTC](https://www.ruby-forum.com/t/question-about-gems-and-databases/147183 "2008-08-29T05:52:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GabrielG1976](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8491ac/32.png) [@GabrielG1976](https://www.ruby-forum.com/u/GabrielG1976)\
**Post date:** [August 29, 2008, 5:52am UTC](https://www.ruby-forum.com/t/question-about-gems-and-databases/147183/1 "2008-08-29T05:52:28Z")

</div>

Hello IM working on a Rails app That requires the midilib gem I have  
installed the gem using gemsonrails and installation went great but i  
was wondering where in my Application do i call the Gem At in my  
application controller or the controller the uses the Gem? Also As Iam  
Using the Midilib gem I want to be able to create a midi file and  
store it in my Mysql Database…

The bases of my App is that is takes a A Text field and then converts  
it into A Midi file

I have created the midi converter in Ruby and its whole conversion is  
based around a tomidi method that i have created and now want to use  
that same Method in my rails app

Thanks for any help

GabrielG1976

---

<div class="post-metadata">

**Author:** ![GabrielG1976](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8491ac/32.png) [@GabrielG1976](https://www.ruby-forum.com/u/GabrielG1976)\
**Post date:** [August 29, 2008, 11:13am UTC](https://www.ruby-forum.com/t/question-about-gems-and-databases/147183/2 "2008-08-29T11:13:30Z")

</div>

Hi,  
Place your midi converter on the lib folder or make it a plugin. Then  
you can use your library from anywhere on your app. By the way, I  
suggest you create a daemon that will check pending conversions,  
depending on how long a conversion takes. If you do the conversion  
directly on a controller, it can collapse your application.  
I don’t know midilib, but I don’t recomend storing files on MySQL, I  
would only store the path to the file, but you can check the BLOB  
field, I’ve never used it on MySQL, only in Oracle and worked fine.

Greetings,

RaY
