Chefspec失败了,“无法加载“ ffi-libarchive”。
我是厨师的新手。最近,我正在研究如何使用ChefSpec测试食谱。但是我总是因为“无法加载FFI-Libarchive”的错误失败。这是我的步骤。
我使用GEM安装ChefSpec- 宝石安装“ Chefspec” 它已成功安装。
然后我写了一本测试食谱 - 示例,带有配方default.rb-
软件包'apache2' 服务“ apache2”做 动作[:启用,:开始] 结束
文件'/srv/www/htdocs/index.html'do 内容 '
欢迎!您已经成功配置了厨师节点。
' 结束然后在c:\ work \ work \ chef-repo \ cookbooks \ sample \ spec中,我创建default_spec.rb -
需要'Chefspec'
描述'索引html'做 LET(:CHEF_RUN){CHEFSPEC :: SORORUNNER.NEW(平台:'suse',版本:'12 .4')。commenge(Diccition_recipe)}
它'删除具有显式操作的文件' 期待(chef_run).to create_file_with_content('/www/srv/index.html','欢迎!您已经成功配置了厨师节点。') 期待(chef_run).to_not delete_file('/tmp/e.log') 结尾
结束
然后我尝试了RSPEC,但它失败了 -
c:\ work \ chef-repo> rspec cookbooks \ sample \ spec \ default_spec.rb 无法加载ffi-libarchive,libarchive可能未安装在系统上,aCRIVE_FILE将不可用 f
失败:
- 索引html删除具有明确操作的文件......
,我再次安装了ffi-libarchive,但是RSPEC仍然失败 -
c:\ work \ chef-repo> gem安装'ffi-libarchive' 成功安装了FFI-Libarchive-1.1.3 FFI-Libarchive-1.1.3的解析文档 完成3秒后安装FFI-Libarchive的文档 安装了1个宝石
c:\ work \ chef-repo> rspec cookbooks \ sample \ spec \ default_spec.rb 无法加载ffi-libarchive,libarchive可能未安装在系统上,aCRIVE_FILE将无法使用
请帮助。预先感谢您的任何想法。
I'm new to chef. Recently, I'm studying how to use chefspec to test recipe. But I always failed with "ffi-libarchive could not be loaded" error. Here's my steps.
I use gem to install chefspec --
gem install 'chefspec'
It's successfully installed.Then I write a test cookbook -- sample, with a recipe default.rb --
package 'apache2'
service 'apache2' do
action [:enable, :start]
endfile '/srv/www/htdocs/index.html' do
content 'Welcome! You have successfully configured your chef node.
'
endThen in c:\work\chef-repo\cookbooks\sample\spec, I create default_spec.rb --
require 'chefspec'
describe 'index html' do
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'suse', version: '12.4').converge(described_recipe) }it 'deletes a file with an explicit action' do expect(chef_run).to create_file_with_content('/www/srv/index.html','Welcome! You have successfully configured your chef node.') expect(chef_run).to_not delete_file('/tmp/e.log') end
end
Then I tried rspec , but it failed --
C:\Work\chef-repo>rspec cookbooks\sample\spec\default_spec.rb
ffi-libarchive could not be loaded, libarchive is probably not installed on system, archive_file will not be available
FFailures:
- index html deletes a file with an explicit action......
So I installed ffi-libarchive again, but the rspec still failed --
C:\Work\chef-repo>gem install 'ffi-libarchive'
Successfully installed ffi-libarchive-1.1.3
Parsing documentation for ffi-libarchive-1.1.3
Done installing documentation for ffi-libarchive after 3 seconds
1 gem installedC:\Work\chef-repo>rspec cookbooks\sample\spec\default_spec.rb
ffi-libarchive could not be loaded, libarchive is probably not installed on system, archive_file will not be availablePlease kind help. Thanks in advance for any idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论