[chef-dev] Re: Ohai Ruby plugin: system ruby vs. running ruby?


Chronological Thread 
  • From: Akzhan Abdulin < >
  • To: Daniel DeLeo < >
  • Cc: Chef Dev < >
  • Subject: [chef-dev] Re: Ohai Ruby plugin: system ruby vs. running ruby?
  • Date: Wed, 31 Aug 2011 23:35:20 +0400

I suppose that, firstly, we need ohai RVM plugin.

And next, we need to report data default ruby.

I.e. system ruby without RVM, or current (rvm use --default) ruby in case of RVM.


2011/8/31 Daniel DeLeo < "> >
 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.





Archive powered by MHonArc 2.6.16.

§