在资源'chef

编程入门 行业动态 更新时间:2024-10-08 05:26:47
资源'chef_gem [mysql]'上执行动作`install`时出错 - 通过Chef Solo安装ruby gem(Error executing action `install` on resource 'chef_gem[mysql]' – installing ruby gem through Chef Solo)

使用Chef 10.24.0,当包含database cookbook时 ,

include_recipe "mysql::server" include_recipe "database::mysql"

mysql gem无法安装,输出如下:

[2013-03-10T19:54:29+00:00] INFO: Processing chef_gem[mysql] action install (mysql::ruby line 36) ================================================================================ Error executing action `install` on resource 'chef_gem[mysql]' ================================================================================ NoMethodError ------------- undefined method `last' for #<Gem::AvailableSet:0x00000002b25be0> Cookbook Trace: --------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb:36:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/database/recipes/mysql.rb:20:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/scafandru/recipes/database.rb:11:in `from_file' Resource Declaration: --------------------- # In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb 36: chef_gem "mysql" Compiled Resource: ------------------ # Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb:36:in `from_file' chef_gem("mysql") do provider Chef::Provider::Package::Rubygems action :install retries 0 retry_delay 2 package_name "mysql" cookbook_name :mysql recipe_name "ruby" end ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/scafandru/recipes/database.rb ================================================================================ NoMethodError ------------- chef_gem[mysql] (mysql::ruby line 36) had an error: NoMethodError: undefined method `last' for #<Gem::AvailableSet:0x00000002b25be0> Cookbook Trace: --------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb:36:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/database/recipes/mysql.rb:20:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/scafandru/recipes/database.rb:11:in `from_file' Relevant File Content: ---------------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb: 29: include_recipe "build-essential" 30: include_recipe "mysql::client" 31: 32: node['mysql']['client']['packages'].each do |mysql_pack| 33: resources("package[#{mysql_pack}]").run_action(:install) 34: end 35: 36>> chef_gem "mysql" 37: [2013-03-10T19:54:31+00:00] ERROR: Running exception handlers [2013-03-10T19:54:31+00:00] ERROR: Exception handlers complete [2013-03-10T19:54:31+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out [2013-03-10T19:54:31+00:00] FATAL: NoMethodError: chef_gem[mysql] (mysql::ruby line 36) had an error: NoMethodError: undefined method `last' for #<Gem::AvailableSet:0x00000002b25be0> Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.

尝试减少可能导致安装失败的所有变量,我放弃了database cookbook,并在mysql::ruby 配方中约束了RubyGem安装

include_recipe "mysql::server" include_recipe "mysql::ruby"

但错误是等价的。

同样适用于最简单的gem_package 安装 :

gem_package 'mysql' do options "--no-ri --no-rdoc" end

我没有想法,有人可以对此有所了解吗?

Using Chef 10.24.0, when including the database cookbook,

include_recipe "mysql::server" include_recipe "database::mysql"

the mysql gem fails to install, with the following output:

[2013-03-10T19:54:29+00:00] INFO: Processing chef_gem[mysql] action install (mysql::ruby line 36) ================================================================================ Error executing action `install` on resource 'chef_gem[mysql]' ================================================================================ NoMethodError ------------- undefined method `last' for #<Gem::AvailableSet:0x00000002b25be0> Cookbook Trace: --------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb:36:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/database/recipes/mysql.rb:20:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/scafandru/recipes/database.rb:11:in `from_file' Resource Declaration: --------------------- # In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb 36: chef_gem "mysql" Compiled Resource: ------------------ # Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb:36:in `from_file' chef_gem("mysql") do provider Chef::Provider::Package::Rubygems action :install retries 0 retry_delay 2 package_name "mysql" cookbook_name :mysql recipe_name "ruby" end ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/scafandru/recipes/database.rb ================================================================================ NoMethodError ------------- chef_gem[mysql] (mysql::ruby line 36) had an error: NoMethodError: undefined method `last' for #<Gem::AvailableSet:0x00000002b25be0> Cookbook Trace: --------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb:36:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/database/recipes/mysql.rb:20:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/scafandru/recipes/database.rb:11:in `from_file' Relevant File Content: ---------------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/ruby.rb: 29: include_recipe "build-essential" 30: include_recipe "mysql::client" 31: 32: node['mysql']['client']['packages'].each do |mysql_pack| 33: resources("package[#{mysql_pack}]").run_action(:install) 34: end 35: 36>> chef_gem "mysql" 37: [2013-03-10T19:54:31+00:00] ERROR: Running exception handlers [2013-03-10T19:54:31+00:00] ERROR: Exception handlers complete [2013-03-10T19:54:31+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out [2013-03-10T19:54:31+00:00] FATAL: NoMethodError: chef_gem[mysql] (mysql::ruby line 36) had an error: NoMethodError: undefined method `last' for #<Gem::AvailableSet:0x00000002b25be0> Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.

Attempting to reduce the all variables that could cause the installation to fail, I discarded the database cookbook, and constrained to the RubyGem installation in the mysql::ruby recipe

include_recipe "mysql::server" include_recipe "mysql::ruby"

but the error was equivalent.

Same applies for the simplest gem_package install:

gem_package 'mysql' do options "--no-ri --no-rdoc" end

I'm out of ideas, can anyone please shed some light into this?

最满意答案

在降级到RubyGems的最新2.0版之前(1.8.5)之后,一切正常。

这个问题很可能会在RubyGems 2.0.3中得到解决 。

After downgrading to the latest pre-2.0 version (1.8.5) of RubyGems, everything works fine.

This issue will most likely be addressed in RubyGems 2.0.3.

更多推荐

本文发布于:2023-08-04 02:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1408568.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:资源   chef

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!