Trouble with test-kitchen

I was attempting to get test-kitchen up and running on my ubuntu machine
tonight for a cookbook I’m working on, but I can’t seem to get past the issue
below.

I’m pretty much a ruby noob, so its very possible I’m doing something wrong,
but I just followed the steps in the quick start guide first

Then I noticed I was getting some issues from foodcritic and FC007
(https://github.com/acrmp/foodcritic/issues/44) so I ran a gem install
foodcritic so that it would update foodcritic. I did take not that thor was not
a dependency that was updated when I did that.

From there I re-run kitchen test and get the following.

Any idea?

Assembling required cookbooks at …

/usr/lib/ruby/1.9.1/rubygems/specification.rb:1615:in raise_if_conflicts': Unable to activate veewee-0.2.3, because thor-0.16.0 conflicts with thor (~> 0.14.6) (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/specification.rb:738:inactivate’
from /usr/lib/ruby/1.9.1/rubygems.rb:209:in rescue in try_activate' from /usr/lib/ruby/1.9.1/rubygems.rb:206:intry_activate’
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:58:in rescue in require' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:inrequire’
from
/home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:5:in rescue in <top (required)>' from /home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:1:in<top
(required)>'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:in
load' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:inblock (2 levels) in load!'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:inblock in load!'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:inload!'
from
/var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:514:in
load_plugins' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:97:ininitialize’
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:in
new' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:invagrant_env’
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:32:in
provision' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:37:inblock in run’
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:48:in
block in each_build' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:ineach’
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:in
each_build' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/cookbook.rb:77:ineach_build’
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:31:in
run' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:107:inrun’
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:71:in run' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/bin/kitchen:7:in<top
(required)>'
from /usr/local/bin/kitchen:19:in load' from /usr/local/bin/kitchen:19:in

Use 'bundle exec kitchen test'

--AJ

On 18 August 2012 14:32, davidpetzel@gmail.com wrote:

I was attempting to get test-kitchen up and running on my ubuntu machine
tonight for a cookbook I'm working on, but I can't seem to get past the issue
below.

I'm pretty much a ruby noob, so its very possible I'm doing something wrong,
but I just followed the steps in the quick start guide first

Then I noticed I was getting some issues from foodcritic and FC007
(FC007 should not be triggered by include_recipe "#{cookbook_name}::blah" · Issue #44 · Foodcritic/foodcritic · GitHub) so I ran a gem install
foodcritic so that it would update foodcritic. I did take not that thor was not
a dependency that was updated when I did that.

From there I re-run kitchen test and get the following.

Any idea?

Assembling required cookbooks at ..........

/usr/lib/ruby/1.9.1/rubygems/specification.rb:1615:in raise_if_conflicts': Unable to activate veewee-0.2.3, because thor-0.16.0 conflicts with thor (~> 0.14.6) (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/specification.rb:738:in activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:209:in rescue in try_activate' from /usr/lib/ruby/1.9.1/rubygems.rb:206:in try_activate'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:58:in rescue in require' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in require'
from
/home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:5:in rescue in <top (required)>' from /home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:1:in <top
(required)>'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:in
load' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:in block (2 levels) in load!'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:in block in load!'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:in load!'
from
/var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:514:in
load_plugins' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:97:in initialize'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:in
new' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:in vagrant_env'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:32:in
provision' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:37:in block in run'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:48:in
block in each_build' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:in each'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:in
each_build' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/cookbook.rb:77:in each_build'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:31:in
run' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:107:in run'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:71:in run' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/bin/kitchen:7:in <top
(required)>'
from /usr/local/bin/kitchen:19:in load' from /usr/local/bin/kitchen:19:in '

Oh.. uhh.. just re-read this..

Use bundler and setup a Gemfile that has 'test-kitchen' in it, then
you can bundle install --binstubs and use bin/test-kitchen or bundle
exec like I said before, i.e.;

https://github.com/fujin/chef-discovery/blob/develop/Gemfile#L4

You should get something like this:

haxstation :: ~/dev/chef-discovery ?develop? ? bundle exec kitchen
test

                                                        1 ?

checking chef-discovery
Running syntax check on chef-discovery
Validating ruby files
Validating templates

Assembling required cookbooks at
[/home/aj/dev/chef-discovery/test/kitchen/.kitchen/cookbooks].
[centos-5.8] Box opscode-centos-5.8 was not found. Fetching box from
specified URL...

Cheers,

--AJ

On 18 August 2012 14:32, davidpetzel@gmail.com wrote:

I was attempting to get test-kitchen up and running on my ubuntu machine
tonight for a cookbook I'm working on, but I can't seem to get past the issue
below.

I'm pretty much a ruby noob, so its very possible I'm doing something wrong,
but I just followed the steps in the quick start guide first

Then I noticed I was getting some issues from foodcritic and FC007
(FC007 should not be triggered by include_recipe "#{cookbook_name}::blah" · Issue #44 · Foodcritic/foodcritic · GitHub) so I ran a gem install
foodcritic so that it would update foodcritic. I did take not that thor was not
a dependency that was updated when I did that.

From there I re-run kitchen test and get the following.

Any idea?

Assembling required cookbooks at ..........

/usr/lib/ruby/1.9.1/rubygems/specification.rb:1615:in raise_if_conflicts': Unable to activate veewee-0.2.3, because thor-0.16.0 conflicts with thor (~> 0.14.6) (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/specification.rb:738:in activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:209:in rescue in try_activate' from /usr/lib/ruby/1.9.1/rubygems.rb:206:in try_activate'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:58:in rescue in require' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in require'
from
/home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:5:in rescue in <top (required)>' from /home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:1:in <top
(required)>'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:in
load' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:in block (2 levels) in load!'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:in block in load!'
from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:in load!'
from
/var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:514:in
load_plugins' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:97:in initialize'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:in
new' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:in vagrant_env'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:32:in
provision' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:37:in block in run'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:48:in
block in each_build' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:in each'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:in
each_build' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/cookbook.rb:77:in each_build'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:31:in
run' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:107:in run'
from
/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:71:in run' from /var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/bin/kitchen:7:in <top
(required)>'
from /usr/local/bin/kitchen:19:in load' from /usr/local/bin/kitchen:19:in '

hmmm. OK, I mentioned I'm a ruby noob, so bundler and creating Gemfile will
be new to me. I'll need to get up to speed on both, and give this a shot.

Out of curiosity, why is veewee even loaded? I'm simply running the tests
against existing baseboxes. As I understand veewee is simply for
automatting the creation of new baseboxes, If we are not creating a new
one, does veewee really need to load? Or is this just a byproduct of way
its included (Again please bear with my ruby 'noobness', if this is a dumb
question)

On Fri, Aug 17, 2012 at 10:58 PM, AJ Christensen aj@junglist.gen.nz wrote:

Oh.. uhh.. just re-read this..

Use bundler and setup a Gemfile that has 'test-kitchen' in it, then
you can bundle install --binstubs and use bin/test-kitchen or bundle
exec like I said before, i.e.;

https://github.com/fujin/chef-discovery/blob/develop/Gemfile#L4

You should get something like this:

haxstation :: ~/dev/chef-discovery ?develop? ? bundle exec kitchen
test

                                                        1 ?

checking chef-discovery
Running syntax check on chef-discovery
Validating ruby files
Validating templates

Assembling required cookbooks at
[/home/aj/dev/chef-discovery/test/kitchen/.kitchen/cookbooks].
[centos-5.8] Box opscode-centos-5.8 was not found. Fetching box from
specified URL...

Cheers,

--AJ

On 18 August 2012 14:32, davidpetzel@gmail.com wrote:

I was attempting to get test-kitchen up and running on my ubuntu machine
tonight for a cookbook I'm working on, but I can't seem to get past the
issue
below.

I'm pretty much a ruby noob, so its very possible I'm doing something
wrong,
but I just followed the steps in the quick start guide first

Then I noticed I was getting some issues from foodcritic and FC007
(FC007 should not be triggered by include_recipe "#{cookbook_name}::blah" · Issue #44 · Foodcritic/foodcritic · GitHub) so I ran a gem install
foodcritic so that it would update foodcritic. I did take not that thor
was not
a dependency that was updated when I did that.

From there I re-run kitchen test and get the following.

Any idea?

Assembling required cookbooks at ..........

/usr/lib/ruby/1.9.1/rubygems/specification.rb:1615:in
raise_if_conflicts': Unable to activate veewee-0.2.3, because thor-0.16.0 conflicts with thor (~> 0.14.6) (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/specification.rb:738:in activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:209:in rescue in try_activate' from /usr/lib/ruby/1.9.1/rubygems.rb:206:in try_activate'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:58:in
rescue in require' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in require'
from
/home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:5:in
rescue in <top (required)>' from /home/user/.vagrant.d/gems/gems/veewee-0.2.3/lib/vagrant_init.rb:1:in <top
(required)>'
from
/var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:in
load' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:68:in block (2 levels) in load!'
from
/var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:42:in block in load!'
from
/var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:in
each' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/plugin.rb:37:in load!'
from
/var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:514:in
load_plugins' from /var/lib/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:97:in initialize'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:in

`new'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:78:in

`vagrant_env'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/runner/vagrant.rb:32:in

`provision'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:37:in

`block in run'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:48:in

`block in each_build'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:in

`each'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/base.rb:47:in

`each_build'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/project/cookbook.rb:77:in

`each_build'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli/test.rb:31:in

`run'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:107:in

`run'
from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/lib/test-kitchen/cli.rb:71:in
`run'

    from

/var/lib/gems/1.9.1/gems/test-kitchen-0.5.0/bin/kitchen:7:in `<top

(required)>'
from /usr/local/bin/kitchen:19:in load' from /usr/local/bin/kitchen:19:in '

Hi David!

On Aug 18, 2012, at 7:17 AM, David Petzel davidpetzel@gmail.com wrote:

Out of curiosity, why is veewee even loaded? I'm simply running the tests against existing baseboxes. As I understand veewee is simply for automatting the creation of new baseboxes, If we are not creating a new one, does veewee really need to load? Or is this just a byproduct of way its included (Again please bear with my ruby 'noobness', if this is a dumb question)

Veewee is a Vagrant plugin and adds new sub-commands to Vagrant's command-line interface, similar to Knife (or RubyGems itself). When Vagrant runs, it searches the Ruby load path for plugins. You appear to have an older version of Veewee installed on your system already which isn't part of the bundle.

What bundler gives you an isolated load path for the gems you execute with "bundle exec" in the context of the bundle - the gems installed and loaded in the Gemfile.lock. Since the bundle doesn't have veewee in it, Vagrant won't try and load it. It isn't intuitive at first, because we often just expect the software we install to work, but this kind of issue is one of the reasons why bundler exists in the first place.

Does that make sense?

--
Opscode, Inc
Joshua Timberman, Technical Program Manager
IRC, Skype, Twitter, Github: jtimberman

Veewee is a Vagrant plugin and adds new sub-commands to Vagrant's
command-line interface, similar to Knife (or RubyGems itself). When Vagrant
runs, it searches the Ruby load path for plugins. You appear to have an
older version of Veewee installed on your system already which isn't part
of the bundle.

This is true, I do have veewee installed, as I had used this machine a
while back to build some baseboxes for another project. I am not actually
using it any longer, do you think removing it would help, or is the bundle
approach the best path forward?

What bundler gives you an isolated load path for the gems you execute with
"bundle exec" in the context of the bundle - the gems installed and loaded
in the Gemfile.lock. Since the bundle doesn't have veewee in it, Vagrant
won't try and load it. It isn't intuitive at first, because we often just
expect the software we install to work, but this kind of issue is one of
the reasons why bundler exists in the first place.

Does that make sense?

At a high level it does make sense, but since I've never really look at
bundler at GemSpec, there is a fair amount of mystery around it (until I
read the docs on that stuff of course :slight_smile: ) I'll certainly take some time
and get up to speed on these and see how I make out.

Thanks again for taking the time to explain it.

On Aug 18, 2012, at 9:50 AM, David Petzel davidpetzel@gmail.com wrote:

This is true, I do have veewee installed, as I had used this machine a while back to build some baseboxes for another project. I am not actually using it any longer, do you think removing it would help, or is the bundle approach the best path forward?

Removing veewee should resolve the issue, I've certainly run into that as well.

However, I think that the habit of using bundler when a project has its own Gemfile is a good one to develop, to avoid the conflicting dependency and library loading as you've seen. It's a habit I try to remember myself. I have an alias in my shell profile to make bundle exec less anoying:

alias b='bundle exec'

--
Opscode, Inc
Joshua Timberman, Technical Program Manager
IRC, Skype, Twitter, Github: jtimberman

Removing veewee should resolve the issue, I've certainly run into that as
well.

So I actually got the same type of issues trying to do the uninstall of
veewee, So I proceed with bundler approach, which appears to be working.
The VM is booting as I type.

However, I think that the habit of using bundler when a project has its
own Gemfile is a good one to develop, to avoid the conflicting dependency
and library loading as you've seen. It's a habit I try to remember myself.
I have an alias in my shell profile to make bundle exec less anoying:

alias b='bundle exec'

Sorry for more questions, but.... If using bundler is good/best practice,
does it make sense that the quick start would list that as the way to get
started, or is the current approach the best for most folks and I just got
jacked up from my previous veewee adventures?

Again I'm REALLY green with ruby, so I won't even pretend to understand all
the details of the bundler approach (aside from the quick reading I've done
on their site since starting this thread).

Thanks Again, I really appreciate the feedback, and sorry if these are
really intro level questions :frowning: