# Ruby Gem question, updating a gem of a called procedure

**URL:** <https://www.ruby-forum.com/t/ruby-gem-question-updating-a-gem-of-a-called-procedure/89756>\
**Category:** Ruby\
**Created:** [March 22, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/ruby-gem-question-updating-a-gem-of-a-called-procedure/89756 "2007-03-22T15:20:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkmd\_nielsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/958977/32.png) [@dkmd\_nielsen](https://www.ruby-forum.com/u/dkmd_nielsen)\
**Post date:** [March 22, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/ruby-gem-question-updating-a-gem-of-a-called-procedure/89756/1 "2007-03-22T15:20:38Z")

</div>

How does one control Gem when it is a gem of a called procedure that  
is being enhanced. The gem to be enhanced has been checked out and I  
would like to unit test it, but the called procedure contains a gem  
statement. Specifically:

Primary procedure does this:

gem ‘CmsStandards’  
require ‘CmsStandards’  
require ‘Project’  
gem ‘CmsPresort’  
require ‘CmsPresort’  
require ‘PresortSummaryReport’

The secondary procedure is in the CmsPresort gem, and the  
CmsPresort.rb header looks like this:

require ‘fileutils’  
require ‘Date’  
require ‘rubygems’  
require ‘zip/zip’  
gem ‘CmsStandards’  
require ‘CmsStandards’  
require ‘Project’  
require ‘ChgTable’  
gem ‘FirstLogicTemplate’  
require ‘FirstLogicTemplate’

It is the FirstLogicTemplate gem that is being enhanced. It is  
“checked out” into a test area; it is the only thing checked out. It  
is the only thing I want checked out. But gem will load it from the  
gem library. Correct?

How does one communicate that the FirstLogicTemplate should be loaded  
from a test library before it is loaded from a production gem library?

Any and all Gem advice will be appreciated. I do not understand how I  
can setup Gem to permit a more traditional library check in/check out  
for development, test, and production.

dvn

---

<div class="post-metadata">

**Author:** ![dkmd\_nielsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/958977/32.png) [@dkmd\_nielsen](https://www.ruby-forum.com/u/dkmd_nielsen)\
**Post date:** [March 25, 2007, 4:01am UTC](https://www.ruby-forum.com/t/ruby-gem-question-updating-a-gem-of-a-called-procedure/89756/2 "2007-03-25T04:01:30Z")

</div>

dkmd\_nielsen wrote:

> Primary procedure does this:
> 
> gem ‘CmsStandards’  
> require ‘CmsStandards’  
> require ‘Project’  
> gem ‘CmsPresort’  
> require ‘CmsPresort’  
> require ‘PresortSummaryReport’

You can actually drop all of the gem statement in the above code (and  
the other example as well). You only need to use the gem statement if  
you wish to load a non-default version of the gem.

> […] But gem will load it from the  
> gem library. Correct?

A gem is only “activated” (i.e. moved into the Ruby load path) if it  
contains a required file that is not normally found. Just make sure  
your test version is available in the load path and the gem will never  
be activated. I test my libraries in this manner all the time.

– Jim W.
