[chef] knife bootstrap alter gem path


Chronological Thread 
  • From: Benoit Caron < >
  • To:
  • Subject: [chef] knife bootstrap alter gem path
  • Date: Wed, 23 Nov 2011 11:39:08 -0500

Hello

I have a server that was manually configured and tweaked. I want to install chef on it so I can gradually automate some stuff on it. So, cloned it, knife bootstrap, I have a registered node in Chef.

But then, the Sinatra apps running on the server throw errors: they can't find the gem for Sinatra (and the other dependancies).

Comparing the config of my two servers, I see that my original VM had :

  - GEM PATHS:
     - /var/lib/gems/1.8
     - /home/ubuntu/.gem/ruby/1.8

and my chef-ized now have:

  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /home/ubuntu/.gem/ruby/1.8

 So:

- 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? 

Thanks for any pointers

Benoit



Archive powered by MHonArc 2.6.16.

§