2

我已经安装了最新的 ChefDK 并浏览了 Chef 网站上的厨房教程之一。当我运行时kitchen list,这是我看到的错误消息:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'vagrant' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

我在这里看到了其他问题,表明这可能与安装的多个或不兼容版本的 kitchen-vagrant gem 有关。当我运行 chef gem list kitchen-vagrant 时,我看到以下内容:

*** LOCAL GEMS ***
kitchen-vagrant (0.20.0)

我已尝试按照其他线程的指导卸载并重新安装 gem(即安装版本 0.16.0)。然而这并没有解决问题。

还运行 chef -v 给了我以下信息:

Chef Development Kit Version: 0.18.26
chef-client version: 12.14.89
delivery version: master (d86679335580be3de22996ef294b20d525889d8d)
berks version: ERROR
kitchen version: ERROR

我不知道为什么伯克斯和厨房会说这样的错误。我不是 ruby​​ 开发人员,所以我不确定我为什么会遇到这个问题。任何帮助,将不胜感激。

这也是厨房诊断的结果——如果有帮助的话:

---
timestamp: 2016-09-24 14:18:39 UTC
kitchen_version: 1.13.1
plugins:
  error:
    exception: "#<Kitchen::ClientError: Could not load the 'vagrant' driver from the
      load path. Please ensure that your driver is installed as a gem or included
      in your Gemfile if using Bundler.>"
    message: Could not load the 'vagrant' driver from the load path. Please ensure
      that your driver is installed as a gem or included in your Gemfile if using
      Bundler.
    backtrace:
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:50:in
      `rescue in for_plugin'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:40:in
      `for_plugin'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:235:in
      `new_driver'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:248:in
      `new_instance'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:144:in
      `block in build_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in
      `map'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in
      `with_index'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in
      `build_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:119:in
      `instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:115:in
      `filtered_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:145:in
      `parse_subcommand'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:56:in
      `load_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:35:in
      `block in call'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:80:in
      `record_failure'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:35:in
      `call'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:56:in
      `perform'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:142:in
      `diagnose'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in
      `run'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in
      `invoke_command'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:334:in
      `invoke_task'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in
      `block in <top (required)>'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/errors.rb:174:in
      `with_friendly_errors'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in
      `<top (required)>'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `load'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `<main>'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'"
loader:
  process_erb: true
  process_local: true
  process_global: true
  global_config: 
  project_config:
    filename: "/Workspace/clique-infrastructure-repo/cookbooks/motd/.kitchen.yml"
    raw_data:
      driver:
        name: vagrant
      provisioner:
        name: chef_solo
      platforms:
      - name: ubuntu-14.04
      - name: centos-7.2
      suites:
      - name: default
        run_list:
        - recipe[motd::default]
        attributes: 
  local_config: 
  combined_config:
    filename: 
    raw_data:
      driver:
        name: vagrant
      provisioner:
        name: chef_solo
      platforms:
      - name: ubuntu-14.04
      - name: centos-7.2
      suites:
      - name: default
        run_list:
        - recipe[motd::default]
        attributes: 
instances:
  error:
    exception: "#<Kitchen::ClientError: Could not load the 'vagrant' driver from the
      load path. Please ensure that your driver is installed as a gem or included
      in your Gemfile if using Bundler.>"
    message: Could not load the 'vagrant' driver from the load path. Please ensure
      that your driver is installed as a gem or included in your Gemfile if using
      Bundler.
    backtrace:
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:50:in
      `rescue in for_plugin'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:40:in
      `for_plugin'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:235:in
      `new_driver'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:248:in
      `new_instance'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:144:in
      `block in build_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in
      `map'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in
      `with_index'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in
      `build_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:119:in
      `instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:115:in
      `filtered_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:145:in
      `parse_subcommand'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:56:in
      `load_instances'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:35:in
      `block in call'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:80:in
      `record_failure'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/diagnose.rb:35:in
      `call'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:56:in
      `perform'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:142:in
      `diagnose'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in
      `run'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in
      `invoke_command'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:334:in
      `invoke_task'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in
      `block in <top (required)>'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/errors.rb:174:in
      `with_friendly_errors'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in
      `<top (required)>'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `load'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `<main>'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'"
    - "/Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'"

这是结果chef gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.6
  - RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin13]
  - INSTALLATION DIRECTORY: /opt/chefdk/embedded/lib/ruby/gems/2.3.0
  - USER INSTALLATION DIRECTORY: /Users/Jaz/.chefdk/gem/ruby/2.3.0
  - RUBY EXECUTABLE: /opt/chefdk/embedded/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/chefdk/embedded/bin
  - SPEC CACHE DIRECTORY: /Users/Jaz/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /opt/chefdk/embedded/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-13
  - GEM PATHS:
     - /opt/chefdk/embedded/lib/ruby/gems/2.3.0
     - /Users/Jaz/.chefdk/gem/ruby/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--user --no-document"
     - "update" => "--user --no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/Jaz/.rvm/gems/ruby-2.3.0/bin
     - /Users/Jaz/.rvm/gems/ruby-2.3.0@global/bin
     - /Users/Jaz/.rvm/rubies/ruby-2.3.0/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Library/gradle-2.8/bin
     - /usr/local/mysql/bin
     - /Users/Jaz/Library/Android/sdk/platform-tools
     - /Users/Jaz/Library/Android/sdk/tools
     - /Users/Jaz/.rvm/bin

这是我的 .kitchen/logs/kitchen.log 文件的结果:

E, [2016-09-24T15:35:12.586307 #1273] ERROR -- Kitchen: ------Exception-------
E, [2016-09-24T15:35:12.586384 #1273] ERROR -- Kitchen: Class: Kitchen::ClientError
E, [2016-09-24T15:35:12.586402 #1273] ERROR -- Kitchen: Message: Could not load the 'vagrant' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.
E, [2016-09-24T15:35:12.586414 #1273] ERROR -- Kitchen: ----------------------
E, [2016-09-24T15:35:12.586425 #1273] ERROR -- Kitchen: ------Backtrace-------
E, [2016-09-24T15:35:12.586435 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:50:in `rescue in for_plugin'
E, [2016-09-24T15:35:12.586446 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:40:in `for_plugin'
E, [2016-09-24T15:35:12.586456 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:235:in `new_driver'
E, [2016-09-24T15:35:12.586467 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:248:in `new_instance'
E, [2016-09-24T15:35:12.586477 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:144:in `block in build_instances'
E, [2016-09-24T15:35:12.586487 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in `map'
E, [2016-09-24T15:35:12.586497 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in `with_index'
E, [2016-09-24T15:35:12.586507 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in `build_instances'
E, [2016-09-24T15:35:12.586517 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:119:in `instances'
E, [2016-09-24T15:35:12.586528 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:115:in `filtered_instances'
E, [2016-09-24T15:35:12.586538 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:145:in `parse_subcommand'
E, [2016-09-24T15:35:12.586548 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/list.rb:32:in `call'
E, [2016-09-24T15:35:12.586558 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:56:in `perform'
E, [2016-09-24T15:35:12.586569 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:120:in `list'
E, [2016-09-24T15:35:12.586579 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
E, [2016-09-24T15:35:12.586589 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
E, [2016-09-24T15:35:12.586599 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:334:in `invoke_task'
E, [2016-09-24T15:35:12.586621 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
E, [2016-09-24T15:35:12.586632 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
E, [2016-09-24T15:35:12.586642 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in `block in <top (required)>'
E, [2016-09-24T15:35:12.586653 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/errors.rb:174:in `with_friendly_errors'
E, [2016-09-24T15:35:12.586663 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in `<top (required)>'
E, [2016-09-24T15:35:12.586673 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `load'
E, [2016-09-24T15:35:12.586683 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `<main>'
E, [2016-09-24T15:35:12.586698 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
E, [2016-09-24T15:35:12.586709 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
E, [2016-09-24T15:35:12.586719 #1273] ERROR -- Kitchen: ----End Backtrace-----
E, [2016-09-24T15:35:12.586729 #1273] ERROR -- Kitchen: ---Nested Exception---
E, [2016-09-24T15:35:12.586739 #1273] ERROR -- Kitchen: Class: LoadError
E, [2016-09-24T15:35:12.586749 #1273] ERROR -- Kitchen: Message: cannot load such file -- kitchen/driver/vagrant
E, [2016-09-24T15:35:12.586759 #1273] ERROR -- Kitchen: ----------------------
E, [2016-09-24T15:35:12.586768 #1273] ERROR -- Kitchen: ------Backtrace-------
E, [2016-09-24T15:35:12.586778 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:50:in `rescue in for_plugin'
E, [2016-09-24T15:35:12.586788 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/driver.rb:40:in `for_plugin'
E, [2016-09-24T15:35:12.586798 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:235:in `new_driver'
E, [2016-09-24T15:35:12.586808 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:248:in `new_instance'
E, [2016-09-24T15:35:12.586818 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:144:in `block in build_instances'
E, [2016-09-24T15:35:12.586828 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in `map'
E, [2016-09-24T15:35:12.586838 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in `with_index'
E, [2016-09-24T15:35:12.586848 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:143:in `build_instances'
E, [2016-09-24T15:35:12.586858 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/config.rb:119:in `instances'
E, [2016-09-24T15:35:12.586868 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:115:in `filtered_instances'
E, [2016-09-24T15:35:12.586878 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command.rb:145:in `parse_subcommand'
E, [2016-09-24T15:35:12.586889 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/command/list.rb:32:in `call'
E, [2016-09-24T15:35:12.586898 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:56:in `perform'
E, [2016-09-24T15:35:12.586909 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:120:in `list'
E, [2016-09-24T15:35:12.586918 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
E, [2016-09-24T15:35:12.586929 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
E, [2016-09-24T15:35:12.586938 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/cli.rb:334:in `invoke_task'
E, [2016-09-24T15:35:12.586948 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
E, [2016-09-24T15:35:12.586958 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
E, [2016-09-24T15:35:12.586968 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in `block in <top (required)>'
E, [2016-09-24T15:35:12.586978 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/lib/kitchen/errors.rb:174:in `with_friendly_errors'
E, [2016-09-24T15:35:12.586988 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.13.1/bin/kitchen:13:in `<top (required)>'
E, [2016-09-24T15:35:12.587001 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `load'
E, [2016-09-24T15:35:12.587012 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/kitchen:23:in `<main>'
E, [2016-09-24T15:35:12.587021 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
E, [2016-09-24T15:35:12.587031 #1273] ERROR -- Kitchen: /Users/Jaz/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
E, [2016-09-24T15:35:12.587041 #1273] ERROR -- Kitchen: ----End Backtrace-----
4

3 回答 3

1

我遇到了完全相同的问题,并尝试遵循在github上找到的建议。那没有用。

最后,这就是为我解决问题的原因:

  • 重新安装 ChefDK,从Chef网站下载
  • gem install kitchen-wrapper
于 2017-02-12T19:21:55.480 回答
0

也许问题是,您没有使用来自厨师的红宝石及其宝石,而是您安装的平台提供的红宝石。您可以通过以下方式找出您正在运行的 ruby​​ 版本:

which ruby

这应该返回一个路径

/opt/opscode 

或类似的东西

如果没有尝试

chef exec kitchen list

有了这个,您将使用厨师自己的厨房,从而使用它的环境。

于 2017-02-21T11:09:15.647 回答
0

所以我遇到的问题是 ubuntu 的 ruby​​ 与 chefdk ruby​​ 不同。

我最终听从了这里的建议:

https://www.bonusbits.com/wiki/HowTo:Install_ChefDK_on_Ubuntu

基本上把它放在你的 .bash_profile 中:

eval "$(chef shell-init bash)"

它将正确更新您的路径。

请注意,.bash_profile 仅在第一次登录时运行,而不是在随后打开的终端上运行。跑:

source ~/.bash_profile

否则,您可能需要重新启动,或者至少注销并再次登录。

于 2017-05-06T20:41:10.390 回答