- From: Daniel DeLeo <
>
- To: Chef Dev <
>
- Subject: [chef-dev] Ohai Ruby plugin: system ruby vs. running ruby?
- Date: Wed, 31 Aug 2011 12:32:43 -0700
Ohai Chefs, we'd like to get your feedback on an issue that's been reported
a few times for ohai[1].
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 `ruby18` or `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:
1. 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.
2. Try to run `ruby18` or `ruby19` (and/or `rbx`, `jruby`, etc.) if there is
no `ruby` in the PATH.
3. 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.
Thanks!
--
Dan DeLeo
1.
http://tickets.opscode.com/browse/OHAI-172 is the canonical ticket, there
are some duplicates as well.
- [chef-dev] Ohai Ruby plugin: system ruby vs. running ruby?, Daniel DeLeo, 08/31/2011
Archive powered by MHonArc 2.6.16.