Macos 'ohai languages/ruby' issue


#1

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
[
"/usr/local/Cellar/ruby/2.6.0/bin"
]

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

macos:~ root# ohai languages/ruby/version
[
"2.3.7"
]
macos:~ root# ohai languages/ruby/bin_dir
[
"/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin"
]
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?

Thanks

Roger