Details
Description
While trying to troubleshoot an nil value for node['languages']['ruby']['gems_dir']
in the most recent chef-server recipe, I discovered that Ohai's ruby language plugin can't find the ruby executable and is thus failing to populate languages[:ruby]:
[root@testing-chefserver01 ~]# ohai | grep -C4 ruby
{
"languages": {
"ruby": {
},
If I add /opt/opscode/embedded/bin to $PATH and run Ohai manually, Ohai is able to find the ruby executable and populate languages[:ruby]:
[root@testing-chefserver01 ~]# echo $PATH
/opt/opscode/embedded/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@testing-chefserver01 ~]# ohai | grep -C4 ruby
{
"languages": {
"ruby": {
"platform": "x86_64-linux",
"version": "1.9.2",
"release_date": "2011-02-18",
"target": "x86_64-unknown-linux-gnu",
However this work-around doesn't work for regular, Upstart-initiated chef-client runs - languages[:ruby] remains empty when the chef-server cookbook runs. I'm unsure if this bug is the fault of the languages/ruby plugin for using the ruby executable to determine the info, or if it is the fault of the Chef omnibus installer for not putting /opt/opscode/embedded/bin in the path or creating a symlink to the ruby executable in a default $PATH location.
Activity
- All
- Comments
- History
- Activity
- Transitions Summary
| Field | Original Value | New Value |
|---|---|---|
| Summary | languages[:ruby] empty on Centos 6.2 | omnibus does not populate languages[:ruby] with omnibus ruby |
| Description |
While trying to troubleshoot an nil value for node['languages']['ruby']['gems_dir']
in the most recent chef-server recipe, I discovered that Ohai's ruby language plugin can't find the ruby executable and is thus failing to populate languages[:ruby]: {{ [root@testing-chefserver01 ~]# ohai | grep -C4 ruby { "languages": { "ruby": { }, }} If I add /opt/opscode/embedded/bin to $PATH and run Ohai manually, Ohai is able to find the ruby executable and populate languages[:ruby]: {{[root@testing-chefserver01 ~]# echo $PATH /opt/opscode/embedded/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin [root@testing-chefserver01 ~]# ohai | grep -C4 ruby { "languages": { "ruby": { "platform": "x86_64-linux", "version": "1.9.2", "release_date": "2011-02-18", "target": "x86_64-unknown-linux-gnu", }} However this work-around doesn't work for regular, Upstart-initiated chef-client runs - languages[:ruby] remains empty when the chef-server cookbook runs. I'm unsure if this bug is the fault of the languages/ruby plugin for using the ruby executable to determine the info, or if it is the fault of the Chef omnibus installer for not putting /opt/opscode/embedded/bin in the path or creating a symlink to the ruby executable in a default $PATH location. |
While trying to troubleshoot an nil value for node['languages']['ruby']['gems_dir']
in the most recent chef-server recipe, I discovered that Ohai's ruby language plugin can't find the ruby executable and is thus failing to populate languages[:ruby]: {code} [root@testing-chefserver01 ~]# ohai | grep -C4 ruby { "languages": { "ruby": { }, {code} If I add /opt/opscode/embedded/bin to $PATH and run Ohai manually, Ohai is able to find the ruby executable and populate languages[:ruby]: {code} [root@testing-chefserver01 ~]# echo $PATH /opt/opscode/embedded/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin [root@testing-chefserver01 ~]# ohai | grep -C4 ruby { "languages": { "ruby": { "platform": "x86_64-linux", "version": "1.9.2", "release_date": "2011-02-18", "target": "x86_64-unknown-linux-gnu", {code} However this work-around doesn't work for regular, Upstart-initiated chef-client runs - languages[:ruby] remains empty when the chef-server cookbook runs. I'm unsure if this bug is the fault of the languages/ruby plugin for using the ruby executable to determine the info, or if it is the fault of the Chef omnibus installer for not putting /opt/opscode/embedded/bin in the path or creating a symlink to the ruby executable in a default $PATH location. |
| Workflow | jira [ 15728 ] | New OSS [ 22810 ] |
| Comment |
[ I did the following to work around this.
Edit the recipe in /tmp/chef-solo/cookbooks/chef-server/recipes/rubygems-install.rb, changing line number 200 to be: gems_dir = "/opt/chef/embedded/lib/ruby/gems/1.9.1" apt-get install ruby1.9.1-dev chef-solo -c /etc/chef/solo.rb -j ~/chef.json Hope this helps. ] |
| Workflow | New OSS [ 22810 ] | OSS: Product Management [ 28787 ] |
| Status | In Progress [ 3 ] | Open [ 1 ] |