[chef] Re: recipes that alter PATH


Chronological Thread 
  • From: Adam Jacob < >
  • To:
  • Subject: [chef] Re: recipes that alter PATH
  • Date: Wed, 7 Jul 2010 16:44:04 -0700

On Wed, Jul 7, 2010 at 10:35 AM, Christopher Bottaro
< >
 wrote:
> Hello,
> I have a recipe that installs rvm and Ruby Enterprise Edition via rvm.  Once
> that recipe runs, I have subsequent recipes that run and install gems.  The
> problem is that they install the gems in system Ruby.
> For rvm to work, I need to source a shell script (which I do in
> /etc/profile.d/rvm.sh).  The problem is that subsequent calls to Chef
> resources like "execute", "gem_package" or "script" don't
> run /etc/profile.d/rvm.sh before executing.  How can I remedy that?
> Thanks for the help.

http://gist.github.com/336957

The trick is to run the RVM command, then evaluate the environment in
the sub-shell and set the current running environment to match.

Best,
Adam

-- 
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: 




Archive powered by MHonArc 2.6.16.

§