[chef] Re: Re: recipes that alter PATH


Chronological Thread 
  • From: Christopher Bottaro < >
  • To:
  • Subject: [chef] Re: Re: recipes that alter PATH
  • Date: Wed, 7 Jul 2010 23:42:26 -0500

Pretty nifty trick!  Unfortunately it doesn't work for me.  Every subsequent use of the "bash" resource errors with "No such file or directory - bash /tmp/chef-script.1990.0".  I printed out my ENV["PATH"] after your ruby_block trick and it looks correct.

I'm using Chef 0.7.16.

Does the reboot cookbook require a certain version of Chef?

Thanks for the help.

On Wed, Jul 7, 2010 at 6:44 PM, Adam Jacob < "> > wrote:
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.

§