I am trying to build a development box via Vagrant/Chef-solo, based on Centos 6.4 and using vagrant-omnibus (1.1.2) to ensure the box is using the latest Chef (while creating/putting together the cookbooks, then I'll probably freeze the version). Currently it installs 11.8.2.
One of the cookbooks is using ruby_build
to install Ruby 2.0.0-p353 and then create symlinks under /usr/local/bin so that Ruby is available to all users after the chef run is complete. It also installs some gems which installation I want to enforce system-wide.
The thing is that using the gem_package
resource after the ruby_build
execution installs the gem in the embedded ruby from the Chef Omnibus installation. Until now I worked around that using the gem_binary
option to force the detection of the system-wide Ruby environment but it got me thinking and so I checked which PATH is used during the Chef run (using a shell_out
to print the PATH to a file) and found out it shows the following:
/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/chef/embedded/bin:/opt/chef/embedded/bin:/usr/local/bin
Where does that come from? How/Why is /opt/chef/embedded/bin
added before /usr/local/bin
?