The Vendor Directory


#1

I’m working with a Development and a Production environment
In order to keep things in synch between the two environments, I thought
it
would be good to “gem unpack” all of my currently installed gems into
the vendor/ directory… so when I push things into Production…
everything
jives.

I unpacked about 20 gems into the vendor/ directory… now everything
is
broke :slight_smile:

I found this article:
http://weblog.textdrive.com/article/180/depending-on-your-vendor-directory
… which had an example that scared me. It has a require statement in
the
code like: require ‘path/gem’ instead of just: require ‘gem’

I thought just unpacking gems into /vendor would work ? Is this not the
case, and I now need to go through every “require” in my code base to
ensure
the correct path is
being referenced ? Please say it isn’t so !


#2

On 1/12/06, Dylan S. removed_email_address@domain.invalid wrote:

http://weblog.textdrive.com/article/180/depending-on-your-vendor-directory
… which had an example that scared me. It has a require statement in the
code like: require ‘path/gem’ instead of just: require ‘gem’

I thought just unpacking gems into /vendor would work ? Is this not the
case, and I now need to go through every “require” in my code base to ensure
the correct path is
being referenced ? Please say it isn’t so !

erm, dunno for sure. But it would take one line in Ruby to go through
each directory in the vendor directory and add that to the load path
(the path that Ruby uses for searching for stuff… I think it’s $: or
something).


#3

Ahh… yes, it is $: indeed (synonymous with LOAD_PATH). Thanks Joe !

So, anyone know if there is a best practice for Rails… like adding a
given
line to environment.rb ?
Just want to know what everybody else is doing, so I’m not reinventing
the
wheel, or implementing something crazy :slight_smile:


#4

Ok… here is an open explanation of the problem:
http://groups.yahoo.com/group/pragmaticstudio/message/269

I was told to run “rake freeze_gems” … however, rake doesn’t even
work.
I moved “all” gems to /vendor.

Anybody ? Pretty please ?