Ohai Chefs, we’d like to get your feedback on an issue that’s been reported a few times for ohai.
The problem is that ohai shells out to the
ruby executable in order to populate the languages/ruby attributes.
This is good because:
- It detects the “system” ruby even if you have several rubies installed, or are running Chef with a different ruby (i.e., running chef under REE or whatever). This is consistent with the other language plugins which detect
python(but not python26)
java, and so on. It’s not consistent with the C plugin which will detect all of GCC, MS, IBM, Sun, and HP-UX compilers.
This is bad because:
- It detects a different ruby than the one you’re using for Chef.
- It does not detect a ruby installed as
ruby19(or rbx or jruby for that matter)
- It’s slower than using rbconfig within the same ruby process.
There’s a few things we could do about this:
- Always use the Ruby that you’re using for ohai/chef-client. If we do this, we could avoid shelling out entirely and the ruby plugin would run faster.
- Try to run
jruby, etc.) if there is no
rubyin the PATH.
- Do the same as #2, but try to find every Ruby we can, e.g., detect all of ruby, ruby18, ruby19, rbx, jruby.
To be honest, I’m not sure what people are using the languages/ruby attributes for, so I’m not able to make a judgement about which of these options is best (or maybe there’s another option?). If this is something that matters to you, please chime in and explain your use case and which course of action would be most helpful to you.
- http://tickets.opscode.com/browse/OHAI-172 is the canonical ticket, there are some duplicates as well.