Macos 'ohai languages/ruby' issue


Hi Team

I have this issue where I would like ohai and chef-client to pick up the version of ruby installed via homebrew, like this:

macos:~ user ohai languages/ruby/version [ "2.6.0" ] macos:~ user ohai languages/ruby/bin_dir

but chef-client will only pick up system ruby like this:

macos:~ root# ohai languages/ruby/version
macos:~ root# ohai languages/ruby/bin_dir
macos:~ root#

I use the "version:" attribute to automatically populate bash_profile PATH variable whenever ruby (homebrew version) is updated.

Running the chef-client manually picks up the desired "version:" (2.6.0), but when chef-client runs as a daemon it shows as "version:" (2.3.7).

Any ideas?