我是厨师新手,但在上传新用户凭据(knife upload
)后尝试更新厨师客户。如果我然后ssh到其中一个服务器并运行sudo chef-client
我收到以下错误:
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/compat_resource/libraries/autoload.rb
================================================================================
LoadError
---------
cannot load such file -- /var/chef/cache/cookbooks/compat_resource/files/lib/compat_resource/gemspec
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/compat_resource/libraries/autoload.rb:15:in `require_relative'
/var/chef/cache/cookbooks/compat_resource/libraries/autoload.rb:15:in `<top (required)>'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/compat_resource/libraries/autoload.rb:
8: cookbook_version = $1
9:
10: if CompatResource::VERSION != cookbook_version
11: raise "compat_resource gem version #{CompatResource::VERSION} was loaded as a gem before compat_resource cookbook version #{cookbook_version} was loaded. To remedy this, either update the cookbook to the gem version, update the gem to the cookbook version, or uninstall / stop loading the gem so early."
12: end
13: else
14: # The gem is not already activated, so activate the cookbook.
15>> require_relative '../files/lib/compat_resource/gemspec'
16: CompatResource::GEMSPEC.activate
17: end
18:
19: require 'compat_resource'
我不太清楚从哪里开始,我已经尝试编辑Berksfile来说:
cookbook 'apt', '= 3.0.0'
然后再次运行knife upload
,但没有快乐。
任何指向正确方向的人都会非常感激!
答案 0 :(得分:0)
您可能正在尝试使用不再与Chef版本兼容的社区烹饪书。你在评论中提到你正在使用Chef 11,所以这并不是特别令人惊讶。您需要手动检查每个社区食谱何时放弃了Chef 11支持,然后按照import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
day = ([ 1 , 2 , 3, 4, 5 , 6 , 7 , 8 , 9])
rain = ([0.6 , 0.8 , np.nan, np.nan, 1 , 6 , 6.5 ,7 , 4])
snow = ([ 1 , 2 , np.nan, np.nan, 0.5 , 7 , 8 , 9 , 10])
df = pd.DataFrame({'rain': rain, 'snow': snow}, index = day)
df.index.name = 'day'
fig, ax = plt.subplots()
line, = ax.plot(df['rain'].fillna(method='ffill'), ls = '--', lw = 1, label='_nolegend_')
ax.plot(df['rain'], color=line.get_color(), lw=1.5, marker = 'o')
line, = ax.plot(df['snow'].fillna(method='ffill'), ls = '--', lw = 1, label='_nolegend_')
ax.plot(df['snow'], color=line.get_color(), lw=1.5, marker = 'o')
plt.legend()
plt.xlabel('day')
plt.ylabel('mm')
plt.show()
那样固定内容。