gpt4 book ai didi

mysql - 无法在 vagrant box 上使用 chef cookbook 安装 mysql-client

转载 作者:行者123 更新时间:2023-11-29 00:07:04 26 4
gpt4 key购买 nike

我一直在尝试使用 this 安装 chef-client| Chef Recipe 。当包含配方 mysql::client 时,它会尝试安装 mysql gem 客户端。抛出很多错误,我无法调试问题。我用谷歌搜索了很多,但什么也没找到。请让我知道解决方案,如果需要我会发布整个堆栈跟踪,但它太长了。

此外,如果我删除 Recipe 的 mysql::client 配方,它将安装 mysql::server 和客户端而不会失败。当我明确包含 mysql::client 时,它会出于某种原因尝试安装 mysql-client gem。

这是错误日志

Error executing action `install` on resource 'chef_gem[mysql]'
==> default: ================================================================================
==> default:
==> default:
==> default:
==> default: Gem::Installer::ExtensionBuildError
==> default:
==> default: -----------------------------------
==> default: ERROR: Failed to build gem native extension.
==> default:
==> default: /opt/chef/embedded/bin/ruby extconf.rb
==> default: checking for mysql_query() in -lmysqlclient... no
==> default: checking for main() in -lm... yes
==> default: checking for mysql_query() in -lmysqlclient... no
==> default: checking for main() in -lz... yes
==> default: checking for mysql_query() in -lmysqlclient... no
==> default: checking for main() in -lsocket... no
==> default: checking for mysql_query() in -lmysqlclient... no
==> default: checking for main() in -lnsl... yes
==> default: checking for mysql_query() in -lmysqlclient... no
==> default: checking for main() in -lmygcc... no
==> default: checking for mysql_query() in -lmysqlclient... no
==> default: *** extconf.rb failed ***
==> default: Could not create Makefile due to some reason, probably lack of
==> default: necessary libraries and/or headers. Check the mkmf.log file for more
==> default: details. You may need configuration options.
==> default:
==> default: Provided configuration options:
==> default: --with-opt-dir
==> default: --with-opt-include
==> default: --without-opt-include=${opt-dir}/include
==> default: --with-opt-lib
==> default: --without-opt-lib=${opt-dir}/lib
==> default: --with-make-prog
==> default: --without-make-prog
==> default: --srcdir=.
==> default: --curdir
==> default: --ruby=/opt/chef/embedded/bin/ruby
==> default: --with-mysql-config
==> default: --without-mysql-config
==> default: --with-mysql-dir
==> default: --without-mysql-dir
==> default: --with-mysql-include
==> default: --without-mysql-include=${mysql-dir}/include
==> default: --with-mysql-lib
==> default: --without-mysql-lib=${mysql-dir}/lib
==> default: --with-mysqlclientlib
==> default: --without-mysqlclientlib
==> default: --with-mlib
==> default: --without-mlib
==> default: --with-mysqlclientlib
==> default: --without-mysqlclientlib
==> default: --with-zlib
==> default: --without-zlib
==> default: --with-mysqlclientlib
==> default: --without-mysqlclientlib
==> default: --with-socketlib
==> default: --without-socketlib
==> default: --with-mysqlclientlib
==> default: --without-mysqlclientlib
==> default: --with-nsllib
==> default: --without-nsllib
==> default: --with-mysqlclientlib
==> default: --without-mysqlclientlib
==> default: --with-mygcclib
==> default: --without-mygcclib
==> default: --with-mysqlclientlib
==> default: --without-mysqlclientlib
==> default:
==> default:
==> default: Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mysql-2.9.1 for inspection.
==> default: Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mysql-2.9.1/ext/mysql_api/gem_make.out
==> default:
==> default:
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/mysql-chef_gem/libraries/provider_mysql_chef_gem.rb:20:in `block in action_install'
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/mysql-chef_gem/libraries/provider_mysql_chef_gem.rb:11:in `action_install'
==> default:
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /tmp/vagrant-chef-3/chef-solo-1/cookbooks/mysql-chef_gem/libraries/provider_mysql_chef_gem.rb
==> default:
==> default: 20: chef_gem 'mysql' do
==> default: 21: action :install
==> default: 22: end
==> default: 23: end
==> default:
==> default:
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /tmp/vagrant-chef-3/chef-solo-1/cookbooks/mysql-chef_gem/libraries/provider_mysql_chef_gem.rb:20:in `block in action_install'
==> default:
==> default: chef_gem("mysql") do
==> default: provider Chef::Provider::Package::Rubygems
==> default: action [:install]
==> default: retries 0
==> default: retry_delay 2
==> default: guard_interpreter :default
==> default: package_name "mysql"
==> default: version "2.9.1"
==> default: cookbook_name :"mysql-chef_gem"
==> default: end
==> default:
==> default:
==> default:

最佳答案

尝试将 mysql cookbook 更新到较新的版本。安装 ruby​​gem 已移至其自己的说明书中,现在在 mysql-chef_gem 说明书中完成。

管理说明书或应用程序的说明书依赖项的最佳方法是使用 berkshelf .借助 berkshelf,您可以轻松地按项目供应您的说明书,然后使用这些供应商的版本来配置您的机器。

如果您直接通过 git 而不是从 supermarket 拉取 cookbook,您可以在此处指定版本或 sha。

关于mysql - 无法在 vagrant box 上使用 chef cookbook 安装 mysql-client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27033091/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com