On Wed, Nov 23, 2011 at 12:50 PM, Bryan McLellan firstname.lastname@example.org wrote:
On Wed, Nov 23, 2011 at 11:39 AM, Benoit Caron email@example.com
Comparing the config of my two servers, I see that my original VM had :
- GEM PATHS:
and my chef-ized now have:
- GEM PATHS:
- Why is Chef altering the gem path?
- Gem newbie question: How can I fix this? What is the “correct” way to
manage this system-wide? Adding a GEM_PATH environment variable in
/etc/profile? Or is there a better way?
From the paths, I presume you’re using Ubuntu which relies heavily on
packages from the Debian project which adheres pretty strictly to its
collective interpretation of the Filesystem Hierarchy Standard (FHS).
The FHS specifies that /usr should be able to be mounted read-only and
shared to network clients. The version of Rubygems that ships with
Debian and Ubuntu install to /var as it is debian policy that all
files under /usr be managed by a debian package; as rubygems installs
additional files (the gems) outside of the packaging, it is moved to
/var . This is the cause for the disputed location of binaries in
/var/lib/gems/1.8/bin , although in Wheezy and later,
/usr/local/bin will be used.
Yes, this is on Ubuntu 10.10.
Historically the versions of Rubygems shipped with Debian and Ubuntu
were too old and had too many bugs for reliable use with Chef, so
we’ve recommended installing Rubygems from source. The default knife
bootstrap template installs Rubygems from source , which defaults
to installing in /usr/lib.
Ok, make sense: that’s what I usually do. This server was setup before my
move to Chef.
The “correct” installation method becomes a matter of preference. If
you prefer debian packages, you could modify a bootstrap template from
the one included for installing on Ubuntu 10.04 (Lucid) using our apt
repository . You can create custom bootstrap templates and specify
them to the knife bootstrap command using the ‘-d DISTRO’ flag.
Additional information on where to locate these files is available on
Good to know: with only one node (that will soon be rebuild) it does not
make much sense, but in the future it can be usefull.
For the record, I’ve fixed my problem by simply adding:
SetEnv GEM_PATH /var/lib/gems/1.8:$GEM_PATH
Thanks a lot for all the references!