# Config.gem vs require 'somegem'

**URL:** <https://www.ruby-forum.com/t/config-gem-vs-require-somegem/148682>\
**Category:** Rails\
**Created:** [September 16, 2008, 7:25am UTC](https://www.ruby-forum.com/t/config-gem-vs-require-somegem/148682 "2008-09-16T07:25:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![giorgio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/cab0a1/32.png) [@giorgio](https://www.ruby-forum.com/u/giorgio)\
**Post date:** [September 16, 2008, 7:25am UTC](https://www.ruby-forum.com/t/config-gem-vs-require-somegem/148682/1 "2008-09-16T07:25:46Z")

</div>

I am very confused by the config.gem statement in 2.1

If I put config.gem ‘pdf-writer’ in my environment.rb I get the  
following error when I try to instanciate a PDF object in my  
controller with the statement pdf = PDF::Writer.new

uninitialized constant CollectionsController::PDF

so I try putting require ‘pdf/writer’ in my environment.rb and the  
application fails to load with:

no such file to load – pdf-writer /usr/local/lib/site\_ruby/1.8/  
rubygems/custom\_require.rb:27:in `gem_original_require' /usr/local/lib/ site_ruby/1.8/rubygems/custom_require.rb:27:in`require’ /usr/lib/ruby/  
gems/1.8/gems/activesupport-2.1.0/lib/active\_support/dependencies.rb:  
509:in `require’  
etc  
…

The gem is in my vendor directory.  
I would like to get to the bottom of this as I have had similar  
problems with gems in the past and I dont really understand whether I  
still need a ‘require’ when I have the ‘config.gem’

Cheers  
George

---

<div class="post-metadata">

**Author:** ![giorgio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/cab0a1/32.png) [@giorgio](https://www.ruby-forum.com/u/giorgio)\
**Post date:** [September 16, 2008, 6:55pm UTC](https://www.ruby-forum.com/t/config-gem-vs-require-somegem/148682/2 "2008-09-16T18:55:20Z")

</div>

Same problem for me.

I have installed ‘rubyist-aasm’ for restful\_authentication, but when I  
insert config.gem ‘rubyist-aasm’, I get an error message.
