[英]Unable to install mysql-client using chef cookbook on a vagrant box
我一直在嘗試使用此廚師食譜安裝Chef-client。 在包含配方mysql :: client中時,它將嘗試安裝mysql gem client。 拋出很多錯誤,我無法調試問題。 我用谷歌搜索了很多,但沒有發現。 請讓我知道解決方案,如果需要的話,我將發布整個堆棧跟蹤,但是它太長了。
另外,如果我刪除食譜的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食譜更新為較新版本。 安裝rubygem已移至其自己的食譜中,現在已在mysql-chef_gem食譜中完成。
管理菜譜或應用程序的菜譜依賴關系的最佳方法是使用berkshelf 。 使用berkshelf,您可以輕松地按項目銷售您的食譜,然后使用這些供應商版本來配置您的計算機。
如果您直接通過git而不是從超級市場拉菜譜,則可以在此處指定版本或sha。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.