【问题标题】:kitchen terraform error - Could not load the 'terraform' driver. Error: undefined method `size' for nil:NilClass厨房 terraform 错误 - 无法加载“terraform”驱动程序。错误:nil:NilClass 的未定义方法“大小”
【发布时间】:2021-10-07 19:10:23
【问题描述】:

我正在关注https://newcontext-oss.github.io/kitchen-terraform/getting_started.html 但是,当我尝试运行时: bundle exec kitchen 会聚

我收到以下错误:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'terraform' driver. Error: undefined method `size' for nil:NilClass
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

有什么想法吗? 运行 TF 1.0.7

【问题讨论】:

    标签: terraform test-kitchen


    【解决方案1】:

    我在学习官方教程时也遇到了这个错误。

    我通过更新 Gemfile 以使用最新版本的 kitchen-terraform 解决了这个问题

    # Gemfile
    
    source "https://rubygems.org/"
    gem "kitchen-terraform", "6.0"
    

    如果它解决了你的问题,请告诉我!

    【讨论】:

    • 非常感谢,这解决了问题。以前我的 Gemfile 包含以下内容: ruby​​ '2.6.8' source "rubygems.org" do gem "kitchen-terraform", "~> 5.8.0" end 我安装了 5.8.0 和 6.0.0 所以不知道为什么行不通,所以我测试了你的解决方案,然后我卸载了 5.8.0 并将其更改为: ruby​​ '2.6.8' source "rubygems.org" do gem "kitchen-terraform", ">= 5.8。 0" end 这样就行了,大概是依赖项之间存在本地冲突的问题。
    猜你喜欢
    • 2021-04-29
    • 1970-01-01
    • 2012-06-13
    • 1970-01-01
    • 1970-01-01
    • 2012-12-27
    • 2015-10-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多