chef-boneyard / knife-container

DEPRECATED: Container support for Chef's Knife Command
Apache License 2.0
57 stars 11 forks source link

Unable to activate knife-container-0.2.4 #52

Open prandelicious opened 9 years ago

prandelicious commented 9 years ago

I installed Chef DK 0.3.6 on Ubuntu 12.04:

root@vagrant-ubuntu-precise-64:~# chef -v
Chef Development Kit Version: 0.3.6

and installed the knife-container via chef gem install knife-container. When I ran chef verify, it gave me this error message:

# which chef
/opt/chefdk/bin/chef
# which knife
/opt/chefdk/bin/knife
# which ruby
/opt/chefdk/embedded/bin/ruby

# chef verify
Running verification for component 'berkshelf'
Running verification for component 'test-kitchen'
Running verification for component 'chef-client'
Running verification for component 'chef-dk'
Running verification for component 'chefspec'
Running verification for component 'rubocop'
Running verification for component 'fauxhai'
Running verification for component 'knife-spork'
Running verification for component 'kitchen-vagrant'
Running verification for component 'package installation'
............

/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2104:in `raise_if_conflicts': Unable to activate knife-container-0.2.4, because json-1.8.2 conflicts with json (<= 1.8.1, >= 1.4.4) (Gem::ConflictError)
eliram commented 9 years ago

Did you managed to solve this?

prandelicious commented 9 years ago

Yes. I edited the spec files and replaced it with the version that is supported.

From: eliram Sent: ‎Thursday‎, ‎February‎ ‎5‎, ‎2015 ‎2‎:‎42‎ ‎PM To: chef/knife-container Cc: Francis Vidal

Did you managed to solve this?

— Reply to this email directly or view it on GitHub.

GenaSG commented 9 years ago

Getting same error on clean ubuntu 14.04 install with ChefDK 0.4.0 and knife-container-0.2.4. Any non-hacky solutions :) ? P.S. I had to edit .chefdk/gem/ruby/2.1.0/specifications/knife-container-0.2.4.gems s.add_runtime_dependency(%q, ["<= 1.8.1", ">= 1.4.4"]) to s.add_runtime_dependency(%q, ["<= 1.8.2", ">= 1.4.4"])

bpowers commented 9 years ago

this is absolutely terrible

a13x212 commented 9 years ago

Same issue on ubuntu 14.04 and chefdk 0.4.0

chef -v Chef Development Kit Version: 0.4.0

Linux jump-02 3.13.0-46-generic #75-Ubuntu SMP Tue Feb 10 15:24:04 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2104:in `raise_if_conflicts': Unable to activate knife-container-0.2.4, because json-1.8.2 conflicts with json (<= 1.8.1, >= 1.4.4) (Gem::ConflictError)

mffrench commented 9 years ago

@prandelicious can you precise the spec file you edited and how ?

radiumx3 commented 9 years ago

@prandelicious @GenaSG Can you please give some details on your solutions please ?

GenaSG commented 9 years ago

I've edited ~/.chefdk/gem/ruby/2.1.0/specifications/knife-container-0.2.4.gems Changed all json related version info to needed (%q, ["<= 1.8.1", ">= 1.4.4"]) to (%q, ["<= 1.8.2", ">= 1.4.4"]) But it's a dirty hack. Right now I'm just using chef-solo provisioning described inside Dockerfile. So docker build would do all needed things.

Sauraus commented 9 years ago

Same here after installing chefdk 0.4.0 knife is borged :( on json 1.8.2

radiumx3 commented 9 years ago

Got the same issue on windows ChefDK install, but can't find that file anywhere :sob:

kplimack commented 9 years ago

i got past all these errors, but its not showing up as a knife-submodule

jmiddleton commented 9 years ago

I've got the same error on the latest version but I solved using GenaSG's approach. My version is running on Docker:

root@ec33ddcd4e34:/# chef -v Chef Development Kit Version: 0.6.0 chef-client version: 12.3.0 berks version: 3.2.4 kitchen version: 1.4.0 root@ec33ddcd4e34:/# uname -a Linux ec33ddcd4e34 3.18.11-tinycore64 #1 SMP Thu Apr 16 17:46:31 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

dfduarte commented 9 years ago

Same error here, using the latest Chef-DK + Json 1.8.3 + RVM System-wide.

Building native extensions. This could take a while... Successfully installed json-1.8.3 Parsing documentation for json-1.8.3 Done installing documentation for json after 0 seconds 1 gem installed

Chef Development Kit Version: 0.6.2 chef-client version: 12.3.0 berks version: 3.2.4 kitchen version: 1.4.0

I've tried to use the Gena's solution, but I had no success with it, because knife raises another error:

/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2104:in `raise_if_conflicts': Unable to activate winrm-s-0.2.4, because winrm-1.3.3 conflicts with winrm (~> 1.2.0) (Gem::ConflictError)

I searched this line in .chefdk/gem/ruby/2.1.0/specifications/knifecontainer.gemspec and .chefdk/gem/ruby/2.1.0/gems/knifecontainer.gemspec, but I didn't found anything, and the error stills happening.

Btw: I needed to uninstall the knife-container plugin after this, because the bug has spreaded for the all knife subcommands. Now, it's working ok.

The container plugin is a great idea, but it's bork from now =(.

tjsoftworks commented 8 years ago

Try blowing away the ~/.chefdk directory. I've had to do this too many times because other troubleshoot ingmethods are too much work ... but this often works for me, to the point where I wonder it the chefdk installer/(updater) shouldn't just check in that directory and figure out what the conflict is and remove the gem(s) or cache file(s) that is causing the issue.

dfduarte commented 8 years ago

Sure, I will try it later.

Btw, I saw that the developer has discontinued the support to knife container, and recomends using the Chef Provisioning plugin for Docker. I think that this is not a problem anymore, so...

djdefi commented 8 years ago

Blowing away the ~/.chefdk directory fixed this for me also looks like

bhanushrestha commented 8 years ago

got the same error and really have no idea how it happened but solution by @GenaSG seems to have solved the problem