Vagrant ubuntu/trusty64 包含导致测试厨房失败的旧版本 Ruby

Vagrant ubuntu/trusty64 contains old version of Ruby which causes test-kitchen to fail

我正在尝试通过 Vagrant 学习 Ansible (Ubuntu/trusty64),并且正在尝试使用 test-kitchen 来断言我的设置。

我遇到的问题是 Vagrant 机器有旧版本 Ruby (1.9.1),因此其中一个依赖项 (busser) 无法 运行。我收到的错误是:

-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
Fetching: busser-0.7.1.gem (100%)
       Successfully installed thor-0.19.0
       Successfully installed busser-0.7.1
       2 gems installed

-----> Installing Busser plugin: busser-serverspec
   /usr/lib/ruby/1.9.1/rubygems/installer.rb:390:in 
'ensure_required_ruby_version_met': rake requires Ruby version >= 2.0.0. 
(Gem::InstallError)

当我 运行 命令 'bundle exec kitchen test' vagrant 从 https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20171208.0.0/providers/virtualbox.box


这是我的 Gemfile,后面是我的 kitchenfile.yml 文件。

source 'https://rubygems.org'
gem 'test-kitchen', '~> 1.19.2'
gem 'kitchen-ansible', '~> 0.48.1'
gem 'kitchen-vagrant', '~> 1.2.1'
gem 'serverspec', '~> 2.41.3'

driver:
  name: vagrant

provisioner:
  name: ansible_playbook
  playbook: playbook.yml
  hosts: all
  require_chef_for_busser: false
  require_ruby_for_busser: true

platforms:
  - name: ubuntu
    driver_config:
      box: "ubuntu/trusty64"

suites:
  - name: default

verifier:
  ruby_bindir: '/usr/bin'

感谢上面的休伯特,我改变了

这个

platforms:
  - name: ubuntu
    driver_config:
      box: "ubuntu/trusty64"

platforms:
  - name: ubuntu/xenial64