# Question About Using A Gem In Rails

**URL:** <https://www.ruby-forum.com/t/question-about-using-a-gem-in-rails/130850>\
**Category:** Rails\
**Created:** [March 3, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/question-about-using-a-gem-in-rails/130850 "2008-03-03T22:21:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [March 3, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/question-about-using-a-gem-in-rails/130850/1 "2008-03-03T22:21:45Z")

</div>

I installed a gem called: Contacts

From the console this works:

Contacts.new(:hotmail, “asdasd”, “asdasd”)"

But from the controller I get “uninitialized constant  
FriendFindersController::Contacts” when I try to load the page? Same  
thing  
if I put the call to Contacts in the model.

Anyone have any ideas?

–  
John K.  
removed\_email\_address@domain.invalid

Blog: [http://www.kopanas.com](http://www.kopanas.com)  
Conference: [http://www.cusec.net](http://www.cusec.net)  
Twits: [http://www.twitter.com/kopanas](http://www.twitter.com/kopanas)

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [March 3, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/question-about-using-a-gem-in-rails/130850/2 "2008-03-03T22:51:53Z")

</div>

Have you required the gem in your environment.rb?  
On Mon, Mar 3, 2008 at 1:19 PM, John K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Anyone have any ideas?
> 
> –  
> John K.  
> removed\_email\_address@domain.invalid
> 
> Blog: [http://www.kopanas.com](http://www.kopanas.com)  
> Conference: [http://www.cusec.net](http://www.cusec.net)  
> Twits: [http://www.twitter.com/kopanas](http://www.twitter.com/kopanas)
> 
> >

–  
Henry  
[http://www.henrywagner.org/](http://www.henrywagner.org/)

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [March 4, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/question-about-using-a-gem-in-rails/130850/3 "2008-03-04T15:35:34Z")

</div>

John K. wrote:

> I installed a gem called: Contacts
> 
> From the console this works:
> 
> Contacts.new(:hotmail, “asdasd”, “asdasd”)"
> 
> But from the controller I get “uninitialized constant  
> FriendFindersController::Contacts” when I try to load the page? Same  
> thing  
> if I put the call to Contacts in the model.
> 
> Anyone have any ideas?
> 
> –  
> John K.  
> removed\_email\_address@domain.invalid
> 
> Blog: [http://www.kopanas.com](http://www.kopanas.com)  
> Conference: [http://www.cusec.net](http://www.cusec.net)  
> Twits: [http://www.twitter.com/kopanas](http://www.twitter.com/kopanas)

Probably, you just need to require the gem in your environment.rb file  
and restart your server.
