# Forcing use of gem in vendor/gems?

**URL:** <https://www.ruby-forum.com/t/forcing-use-of-gem-in-vendor-gems/169291>\
**Category:** Rails\
**Created:** [June 1, 2009, 11:57pm UTC](https://www.ruby-forum.com/t/forcing-use-of-gem-in-vendor-gems/169291 "2009-06-01T23:57:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![helix\_tp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/ed655f/32.png) [@helix\_tp](https://www.ruby-forum.com/u/helix_tp)\
**Post date:** [June 1, 2009, 11:57pm UTC](https://www.ruby-forum.com/t/forcing-use-of-gem-in-vendor-gems/169291/1 "2009-06-01T23:57:45Z")

</div>

Sorta surprised this isn’t a FAQ, but…

Maybe this is not good practice, but I have a gem that is both installed  
in the system and in vendor/gems. The vendor/gems copy has some local  
mods. Seems like the only way I could find to forced that one to be  
loaded for capistrano over the system one was to put:

$LOAD\_PATH.insert 0,  
“#{File.dirname( **FILE** )}/…/vendor/gems/myfavoritegem/lib”

in deploy.rb.

Is that really the best way to do it? I guess I was sort of figuring  
that vendor/gems would be preferred over the system gem library, in the  
case of duplicates.

Thanks,

dwh
