Chef gem_package does not use the correct binary

I am trying to set the sensu_plugin and mixlib-shellout jewels on a Windows 2008r2 server from a recipe. In this last one, I have the following code:

%w{ sensu-plugin mixlib-shellout }.each do |gem_plugin|
  gem_package gem_plugin do
    gem_binary("C:/opt/sensu/embedded/bin/gem")
    options("--no-rdoc --no-ri")
    action :install
  end
end

However, when I run the recipe on my machine, I get the error message "ERROR: when executing gem ... (Errno :: ENOENT) There is no such file or directory - U: /". I found out that whenever I try to install the gem package using the gem binary located in the chef-client directory (C: \ opscode \ chef \ embedded \ bin \ gem), it raised this last error.

The fact is that the stone that I want to use to install gem packages is actually located in C: / opt / sensu / embedded / bin / gem, which I declared in the gem_binary option.

In the end, the chef seems to be ignoring the gem_binary parameter and trying to set it from his own binary code.

I do not see what is wrong with this config. Does gem_binary really indicate which binary to use?

+3
source share

All Articles