test-kitchen / kitchen-vagrant

A Test Kitchen Driver for Vagrant
Other
349 stars 189 forks source link

Missing gem version of vagrant #64

Closed jansauer closed 10 years ago

jansauer commented 10 years ago

I'm unable to run test-kitchen after installing and initializing it. Seems like vagrant is expected to be installed as a gem.

$ bundle exec kitchen test
-----> Starting Kitchen (v1.1.1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ShellOut::ShellCommandFailed
>>>>>> Message: Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT:
STDERR: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.5.2/lib/bundler/rubygems_integration.rb:240:in `block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
    from /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/bin/vagrant:22:in `<main>'
---- End output of vagrant --version ----
Ran vagrant --version returned 1
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details

kitchen.log

I, [2014-01-15T13:22:40.114361 #38525]  INFO -- Kitchen: -----> Starting Kitchen (v1.1.1)
E, [2014-01-15T13:22:40.482654 #38525] ERROR -- Kitchen: ------Exception-------
E, [2014-01-15T13:22:40.482875 #38525] ERROR -- Kitchen: Class: Kitchen::ShellOut::ShellCommandFailed
E, [2014-01-15T13:22:40.482996 #38525] ERROR -- Kitchen: Message: Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT: 
STDERR: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.5.2/lib/bundler/rubygems_integration.rb:240:in `block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
    from /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/bin/vagrant:22:in `<main>'
---- End output of vagrant --version ----
Ran vagrant --version returned 1
E, [2014-01-15T13:22:40.483082 #38525] ERROR -- Kitchen: ---Nested Exception---
E, [2014-01-15T13:22:40.483146 #38525] ERROR -- Kitchen: Class: Mixlib::ShellOut::ShellCommandFailed
E, [2014-01-15T13:22:40.483211 #38525] ERROR -- Kitchen: Message: Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT: 
STDERR: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.5.2/lib/bundler/rubygems_integration.rb:240:in `block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
    from /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/bin/vagrant:22:in `<main>'
---- End output of vagrant --version ----
Ran vagrant --version returned 1
E, [2014-01-15T13:22:40.483275 #38525] ERROR -- Kitchen: ------Backtrace-------
E, [2014-01-15T13:22:40.483329 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/shell_out.rb:70:in `rescue in run_command'
E, [2014-01-15T13:22:40.483406 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/shell_out.rb:59:in `run_command'
E, [2014-01-15T13:22:40.483458 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/driver/base.rb:158:in `run_command'
E, [2014-01-15T13:22:40.483503 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kitchen-vagrant-0.14.0/lib/kitchen/driver/vagrant.rb:127:in `silently_run'
E, [2014-01-15T13:22:40.483547 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kitchen-vagrant-0.14.0/lib/kitchen/driver/vagrant.rb:204:in `vagrant_version'
E, [2014-01-15T13:22:40.483590 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kitchen-vagrant-0.14.0/lib/kitchen/driver/vagrant.rb:212:in `check_vagrant_version'
E, [2014-01-15T13:22:40.483634 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kitchen-vagrant-0.14.0/lib/kitchen/driver/vagrant.rb:100:in `verify_dependencies'
E, [2014-01-15T13:22:40.483678 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/driver.rb:45:in `for_plugin'
E, [2014-01-15T13:22:40.483722 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/config.rb:124:in `new_driver'
E, [2014-01-15T13:22:40.483765 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/config.rb:130:in `new_instance'
E, [2014-01-15T13:22:40.483809 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/config.rb:73:in `block in build_instances'
E, [2014-01-15T13:22:40.483852 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/config.rb:72:in `map'
E, [2014-01-15T13:22:40.483896 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/config.rb:72:in `with_index'
E, [2014-01-15T13:22:40.483940 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/config.rb:72:in `build_instances'
E, [2014-01-15T13:22:40.484015 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/config.rb:52:in `instances'
E, [2014-01-15T13:22:40.484067 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/cli.rb:342:in `get_filtered_instances'
E, [2014-01-15T13:22:40.484118 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/cli.rb:327:in `parse_subcommand'
E, [2014-01-15T13:22:40.484167 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/cli.rb:141:in `block in test'
E, [2014-01-15T13:22:40.484216 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
E, [2014-01-15T13:22:40.484262 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/cli.rb:137:in `test'
E, [2014-01-15T13:22:40.484307 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
E, [2014-01-15T13:22:40.484350 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
E, [2014-01-15T13:22:40.484398 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/cli.rb:288:in `invoke_task'
E, [2014-01-15T13:22:40.484443 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
E, [2014-01-15T13:22:40.484487 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
E, [2014-01-15T13:22:40.484531 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/bin/kitchen:13:in `block in <top (required)>'
E, [2014-01-15T13:22:40.484576 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/lib/kitchen/errors.rb:81:in `with_friendly_errors'
E, [2014-01-15T13:22:40.484619 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/test-kitchen-1.1.1/bin/kitchen:13:in `<top (required)>'
E, [2014-01-15T13:22:40.484663 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/bin/kitchen:23:in `load'
E, [2014-01-15T13:22:40.484706 #38525] ERROR -- Kitchen: /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/bin/kitchen:23:in `<main>'
E, [2014-01-15T13:22:40.484749 #38525] ERROR -- Kitchen: ----------------------

Gemfile

source 'https://rubygems.org'

gem 'berkshelf'

group :ci do
  gem 'rubocop'
  gem 'foodcritic'
  gem 'test-kitchen'
  gem 'kitchen-vagrant'
end
jansauer commented 10 years ago

Reinstalling everything fixed the problem.

$ for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
$ gem install bundler
$ bundle install
tmatilai commented 10 years ago

@JanSauer you had Vagrant installed (also) via some Bundler setup, which had created /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/bin/vagrant. But when executed directly from shell (via test-kitchen), it doesn't find its libraries. Fast fix is just to remove that file.

jansauer commented 10 years ago

@tmatilai Thx Was a leftover from https://github.com/berkshelf/berkshelf/wiki/Howto:-Use-the-bleeding-edge

afiune commented 10 years ago

That happened to me as well. I've had the leftover on this path: c:/opscode/chef/embedded/bin/vagrant Removing this has solved the issue.

patcon commented 9 years ago

fwiw I'm on Ubuntu 14.04, and seeing the same thing. I've uninstalled all gems, but it keeps coming back, even though I have no gem versions of vagrant installed in the active version, nor in any other rbenv gem version :/

/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ kitchen list         
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ShellOut::ShellCommandFailed
>>>>>> Message: Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT: 
STDERR: /home/patcon/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler/rubygems_integration.rb:292:in `block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
    from /home/patcon/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/bin/vagrant:22:in `<main>'
---- End output of vagrant --version ----
Ran vagrant --version returned 1
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ kitchen --version
Test Kitchen version 1.3.1
/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ vagrant --version
Vagrant 1.7.2
/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ rbenv version
2.1.0 (set by /home/patcon/.rbenv/version)
/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ gem list

*** LOCAL GEMS ***

addressable (2.3.8, 2.3.7)
ast (2.0.0)
astrolabe (1.3.0)
berkshelf (3.2.4, 3.2.3)
berkshelf-api-client (1.3.0, 1.2.1)
bigdecimal (1.2.3)
buff-config (1.0.1)
buff-extensions (1.0.0)
buff-ignore (1.1.1)
buff-ruby_engine (0.1.0)
buff-shell_out (0.2.0)
builder (3.2.2)
bundler (1.10.4)
busser (0.7.1, 0.6.0)
busser-serverspec (0.5.7, 0.5.6, 0.2.8)
celluloid (0.16.0)
celluloid-io (0.16.2)
chef (12.4.0, 12.3.0)
chef-config (12.4.0)
chef-zero (4.2.3)
chefspec (4.2.0)
chronic (0.10.2)
cleanroom (1.0.0)
coderay (1.1.0)
dep-selector-libgecode (1.0.2)
dep_selector (1.0.3)
diff-lcs (1.2.5)
doing (0.2.5)
erubis (2.7.0)
faraday (0.9.1)
fauxhai (2.3.0)
ffi (1.9.9, 1.9.8, 1.9.6)
ffi-yajl (2.2.0)
foodcritic (4.0.0, 3.0.3)
gherkin (2.12.2, 2.11.8)
gli (2.9.0)
haml (4.0.3)
hashie (2.1.2)
highline (1.7.2)
hitimes (1.2.2)
httpclient (2.6.0.1)
io-console (0.4.2)
ipaddress (0.8.0)
json (1.8.3, 1.8.2, 1.8.1)
kitchen-docker (2.1.0)
kitchen-vagrant (0.18.0, 0.16.0)
libyajl2 (1.2.0)
method_source (0.8.2)
mime-types (2.6.1)
mini_portile (0.6.2)
minitar (0.5.4)
minitest (4.7.5)
mixlib-authentication (1.3.0)
mixlib-cli (1.5.0)
mixlib-config (2.2.1)
mixlib-log (1.6.0)
mixlib-shellout (2.1.0, 2.0.1)
multi_json (1.11.1, 1.11.0)
multipart-post (2.0.0)
net-http-persistent (2.9.4)
net-scp (1.2.1)
net-ssh (2.9.2)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.2.1)
nio4r (1.1.0)
nokogiri (1.6.6.2, 1.5.11)
octokit (3.8.0)
ohai (8.5.0, 8.4.0)
parser (2.2.2.5)
plist (3.1.0)
polyglot (0.3.5)
powerpack (0.1.1)
pry (0.10.1)
psych (2.0.2)
rack (1.6.4)
rainbow (2.0.0)
rake (10.4.2, 10.1.0)
rdoc (4.1.0)
retryable (2.0.1)
ridley (4.2.0, 4.1.2)
rspec (3.3.0)
rspec-core (3.3.1)
rspec-expectations (3.3.0)
rspec-its (1.2.0)
rspec-mocks (3.3.1)
rspec-support (3.3.0)
rspec_junit_formatter (0.2.3)
rubocop (0.32.1, 0.32.0, 0.31.0)
ruby-progressbar (1.7.5)
rufus-lru (1.0.5)
safe_yaml (1.0.4)
sawyer (0.6.0)
semverse (1.2.1)
serverspec (2.19.0)
slop (3.6.0)
solve (1.2.1)
specinfra (2.36.6, 2.36.1)
syslog-logger (1.6.8)
systemu (2.6.5)
test-kitchen (1.4.1, 1.4.0, 1.3.1)
test-unit (2.1.0.0)
thor (0.19.1, 0.19.0)
tilt (2.0.1)
timers (4.0.1)
treetop (1.6.2, 1.4.15)
uuidtools (2.1.5)
varia_model (0.4.0)
wmi-lite (1.0.0)
yajl-ruby (1.2.1, 1.1.0)
/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ which vagrant
/usr/bin/vagrant
/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ echo $PTH

/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ echo $PATH
/home/patcon/.rbenv/shims:/home/patcon/.rbenv/bin:/home/patcon/.npm-packages/bin:/opt/chefdk/bin:/home/patcon/.rbenv/shims:/home/patcon/.rbenv/bin:/home/patcon/.npm-packages/bin:/home/patcon/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/patcon/android/sdk/tools:/home/patcon/android/sdk/platform-tools:/home/patcon/android/sdk/tools:/home/patcon/android/sdk/platform-tools
/non_encrypted/repos/chef-textsecure (master ✘)✹✭ ᐅ 
patcon commented 9 years ago

Ah. Went back to bash shell instead of zsh, and I'm finally able to get past that error...! Likely a zsh plugin, then