ohai icon indicating copy to clipboard operation
ohai copied to clipboard

languages[:ruby][:gem_bin_dir] is not correctly set

Open damm opened this issue 8 years ago • 0 comments

Description

  • Using ruby from Ubuntu 16.04 node['languages']['ruby']['gem_bin_dir'] is pointed to /usr/bin however binaries are installed into /usr/local/bin.

Ohai Version

root@warehouse:~# ohai --version Ohai: 8.14.0

Tell us which version of Ohai you are using.

Platform Version

root@warehouse:~# ohai platform
[
  "ubuntu"
]
root@warehouse:~# ohai platform_version
[
  "16.04"
]

Ohai Output

https://gist.github.com/damm/54a944dde9ed3c4459b42ee0f104d2d2

Personal debugging

Reviewing the code I noticed we use rbconfig here to determine the binary path; it appears rbconfig is lying here. Rubygems knows the right answer

irb(main):008:0* Gem.bindir
=> "/usr/local/bin"
irb(main):009:0> RbConfig::CONFIG['bindir']
=> "/usr/bin"
irb(main):010:0>

damm avatar Nov 10 '16 00:11 damm