"Kitchen list" command fails with "Could not load the 'ssh' transport from the load path"

3.8k Views Asked by At

I'm trying to add a Test Kitchen to a Chef cookbook but am getting the error "Could not load the 'ssh' transport from the load path".

I have previously set up a Test Kitchen following the exact same steps without issue, but that was on a different machine.

I've tried running

gem install net-ssh 

But that doesn't seem to fix the problem

2

There are 2 best solutions below

0
On BEST ANSWER

Solved it.

I ran

gem list

Which gave the output

..
net-ssh (2.10.0.beta2, 2.9.2)
..

I then issued the command:

gem uninstall net-ssh 2.10.9.beta2

And got the output:

Select gem to uninstall:
 1. net-ssh-2.10.0.beta2
 2. net-ssh-2.9.2
 3. All versions

Whereupon I selected option 1, the gem was removed and then running

kitchen list

Worked as expected

0
On

I was running into the same problem for Java SE Chef cookbook on Travis-CI with:

Chef Development Kit Version: 0.10.0
chef-client version: 12.6.0
berks version: 4.0.1
kitchen version: 1.5.0

Throwing this:

-----> Starting Kitchen (v1.5.0)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'ssh' transport from the load path. Please ensure that your transport is installed as a gem or included in your Gemfile if using Bundler.
>>>>>> ----------------------

I had to switch to Dokken to get it to work: https://github.com/someara/kitchen-dokken


To fix:

Update .travis.yml to install kitchen-dokken:

/opt/chefdk/embedded/bin/chef gem install kitchen-dokken

And update .kitchen.docker.yml with:

transport:
  name: dokken

provisioner:
  name: dokken

verifier:
  root_path: '/opt/verifier'
  sudo: false

driver:
  name: dokken