# How do i use a newly installed gem?

**URL:** <https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159>\
**Category:** Rails\
**Created:** [September 9, 2008, 10:37pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159 "2008-09-09T22:37:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [September 9, 2008, 10:37pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159/1 "2008-09-09T22:37:21Z")

</div>

Hi - I wanted to try out the Blackbook gem:

[http://contentfree.rubyforge.org/blackbook/](http://contentfree.rubyforge.org/blackbook/)

So I did

gem install blackbook

and I kept getting failures installing, and finally I used the –  
ignore-dependencies flag in gem install, and I got it installed. Now I  
try to do something very simple like

contacts = Blackbook.get :username =\> ‘removed\_email\_address@domain.invalid’, :password =\>  
‘password’

and I get

NameError: uninitialized constant Blackbook

at both the console and in the debugger. my question is, do I have to  
do something to use the newly installed gem? I’m new to gems and have  
only used them for examples and such.

Thanks for any help,  
Dino

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [September 9, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159/2 "2008-09-09T22:48:29Z")

</div>

Did you require the gem?

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [September 9, 2008, 11:06pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159/3 "2008-09-09T23:06:40Z")

</div>

I didn’t originally, but now I did. I added:

require ‘blackbook’

and now, I get

no such file to load – blackbook

I’ve checked and blackbook.rb is installed here:

C:\ruby\lib\ruby\gems\1.8\gems\blackbook-1.0.4\lib

i don’t have any idea how ruby looks for gems or where. this error  
tells me it can’t find blackbook.rb. Any ideas?

Thanks,  
Dino

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [September 9, 2008, 11:28pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159/4 "2008-09-09T23:28:39Z")

</div>

Is this is Rails 2.1?

If so did you look at the comments pertaining to gems in  
config/environment.rb?

Example:  
config.gem “hpricot”, :version =\> ‘0.6’, :source =\>  
“[http://code.whytheluckystiff.net](http://code.whytheluckystiff.net)”

dino d. wrote:

> I didn’t originally, but now I did. I added:
> 
> require ‘blackbook’
> 
> and now, I get
> 
> no such file to load – blackbook
> 
> I’ve checked and blackbook.rb is installed here:
> 
> C:\ruby\lib\ruby\gems\1.8\gems\blackbook-1.0.4\lib
> 
> i don’t have any idea how ruby looks for gems or where. this error  
> tells me it can’t find blackbook.rb. Any ideas?
> 
> Thanks,  
> Dino

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [September 9, 2008, 11:35pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159/5 "2008-09-09T23:35:26Z")

</div>

> If so did you look at the comments pertaining to gems in  
> config/environment.rb?  
> Or optionally you may consider “vendoring” the gem.

See: [Vendor Everything — err.the\_blog](http://errtheblog.com/posts/50-vendor-everything)

Robert W. wrote:

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [September 9, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159/6 "2008-09-09T23:37:13Z")

</div>

no, i’m running rails 2.0.2

thanks for your help so far.

On Sep 9, 5:28 pm, Robert W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [September 10, 2008, 4:04pm UTC](https://www.ruby-forum.com/t/how-do-i-use-a-newly-installed-gem/148159/7 "2008-09-10T16:04:01Z")

</div>

SOLVED!

The problem was that since the installer failed, I had to install  
without dependencies. Apparently, I forgot to manually install  
fastercsv, but instead of throwing a message like ‘no fastercsv,’ it  
said ‘no such file to load.’ Thanks for your help guys.

dino
