2017-06-29 52 views
0

我正在尝试向Foreman注册现有的主厨节点。我跟着:配置错误LoadError:无法加载这样的文件 - chef_handler_foreman(在/etc/chef/client.rb中需要声明)

https://www.theforeman.org/plugins/foreman_chef/0.5/index.html

这告诉我安装chef_handler_foreman宝石,放在/etc/chef/client.rb如下:

require 'chef_handler_foreman'

foreman_server_options ' https://your.proxy.server:8443 '

foreman_facts_upload true

foreman_reports_upload true

foreman_enc true

我做了两个。

当我运行厨师客户端,我得到:

[[email protected] chef]# chef-client

[2017-06-29T13:25:09-04:00] FATAL: Configuration error LoadError: cannot load such file -- chef_handler_foreman

[2017-06-29T13:25:09-04:00] FATAL: /etc/chef/client.rb:4:in `from_string'

[2017-06-29T13:25:09-04:00] FATAL: Aborting due to error in '/etc/chef/client.rb'

[[email protected] chef]#

这里是我安装了宝石的证据:我的Redhat 7.3运行

[[email protected] chef]# gem list | grep chef

chef_handler_foreman (0.2.0)

我看了下面的问题和几个其他人。这些问题的答案提示了一个区分大小写的问题,但这里并非如此:

LoadError: cannot load such file -- english

我在做什么错?任何帮助表示赞赏。

+0

请用'knife --verbose --verbose'运行得到完整的回溯。 – coderanger

+0

试试'/ opt/chef/embedded/bin/gem list | grep foreman'我怀疑你的系统中安装了宝石ruby,而不是厨师的红宝石。 – Tensibai

+0

宾果! @Tensibai。就是这样!谢谢!如果您将其作为答案提交,我会将其标记为如此。再次感谢! – Mamun

回答

2

您应该检查/opt/chef/embedded/bin/gem list | grep foreman

我怀疑你的系统中安装了ruby,而不是ruby捆绑在omnibus安装程序中的chef ruby​​,以避免与系统ruby发生冲突。

通常你应该使用厨师在厨师内部安装宝石并配置自己。 用chef_gem资源安装宝石,并利用chef_client cookbook来配置厨师。

相关问题