Using chef
I have a simple recipe that sets up a gem, for example:
gem_package "passenger" do version node['passenger']['version'] end
I also want to install ruby ββwith another cookbook, it could be Ruby 1.9.3 for some servers and Ruby Enterprise 1.8.7 for others. So I decided to use gem_binary
and ohai
for this, for example:
gem_package "passenger" do version node['passenger']['version'] gem_binary "#{languages['ruby']['bin_dir']/gem}" end
But then the problems begin, because languages['ruby']
does not change when a new ruby ββis installed. Ruby Enterprise installs in /opt/ruby-enterprise
and adds itself to PATH
through /etc/profile.d/ree.sh
, but does not get it for ohai
during the same run, but gets it in the next run.
The first launch of ohai
says that languages['ruby']
set to /opt/vagrant_ruby/bin/ruby
when used with vagrant
and chef_solo
. And the passenger pearl is set in the wrong ruby.
How can I make ohai
recognize a newly installed ruby?
source share