schubergphilis / vagrant-chef-zero

Vagrant Plugin for Chef Zero
Apache License 2.0
91 stars 41 forks source link

JSON dependency error #23

Open capoferro opened 11 years ago

capoferro commented 11 years ago

ERROR root: -- Error: #<Gem::LoadError: Unable to activate chef-11.6.2, because json-1.8.0 conflicts with json (<= 1.7.7, >= 1.4.4)>

I suspect that Ridley is causing 1.8.0 to be loaded, as it has a >= 1.7.7 version constraint.

andrewgross commented 11 years ago

Fun, more JSON problems. Thanks for reporting, I will check this out for my next pass over of the plugin.

paulczar commented 11 years ago

This seems to be an issue with the order in which you install plugins. @mattray helped me with the same issue.

turns out you need to install them in this order : vagrant-omnibus, vagrant-chef-zero, vagrant-berkshelf

mattray commented 11 years ago

It seems the Gemfile should probably match exactly what Chef has to ensure proper behavior.

andrewgross commented 11 years ago

I love ruby...

I will try to rearrange the deps this weekend.

andrewgross commented 11 years ago

I pushed version 0.5.1 to attempt to fix this dependency issue. Let me know if it helps!

Thanks for the comments.

stormbrew commented 11 years ago

Neither using 0.5.1 nor installing plugins in the order described above (unless there's some step I'm missing in cleaning out vagrant's plugins before reinstalling them) solves this issue for me.

anthroprose commented 10 years ago

Uninstalling & re-installing in the suggested order no longer works.

New installs fail. Is there an actual hard dependency on that json version necessitating a refactor?

andrewgross commented 10 years ago

No hard dependency. Just ruby/bundler silliness. On Jan 9, 2014 12:14 PM, "Alex Corley" notifications@github.com wrote:

Uninstalling & re-installing in the suggested order no longer works.

New installs fail. Is there an actual hard dependency on that json version necessitating a refactor?

— Reply to this email directly or view it on GitHubhttps://github.com/andrewgross/vagrant-chef-zero/issues/23#issuecomment-31954612 .

anthroprose commented 10 years ago

So I'm assuming:

s.add_dependency "json", ">= 1.4.4", "<= 1.7.7" s.add_dependency "json", ">= 1.4.4"

Won't cut it? It's an order of operation/complex system issue?

jpruetting commented 10 years ago
Bundler could not find compatible versions for gem "json":

  In Gemfile:
    vagrant-chef-zero (>= 0) ruby depends on
      json (<= 1.7.7, >= 1.4.4) ruby

    berkshelf (>= 0) ruby depends on
      json (1.8.1)
anthroprose commented 10 years ago

@jpruetting Sure, but as @andrewgross said, there is no hard dependency on json <=1.7.7, so why even have it there to cause order of operations issues in the bundler process at all?

I'm most likely not understanding the issue completely, just trying to get my tests running proper.

mattray commented 10 years ago

Hmm... I haven't looked at this lately but the json 1.7.7 is there because Chef has to support Ruby 1.8.7 and later versions of json don't respect semver. There's talk of dropping 1.8.7 soon, so this would go away. Berkshelf might want to be pinned to less than <3 for now, still conflicts between Berkshelf 3 and Chef 11 dependencies AFAIK. The Chef dependency was added so we could pull in .rb environments and roles, it looks like Chef-Zero still doesn't have that functionality yet.

anthroprose commented 10 years ago

@mattray Many thanks for a full explanation, I kinda figured it was ecosystem/systemic more than a simple version tie for this particular project.

I'll re-try the plugin order-of-operations install, but after removing the json gem.

andrewgross commented 10 years ago

Originally the explicit dependency was added to avoid a bug in Bundler being unable to resolve the dependency graph.

andrewgross commented 10 years ago

In 0.6.0 I have removed my custom gem version constraints (still have Chef dependency). I have tested it with Vagrant 1.4, but let me know if it fixes your issue.

cdearborn commented 10 years ago

I'm experiencing almost the same failure, but the detailed error message is a little different. I installed the plugins in the order indicated above and all installed successfully. I get the following on "vagrant up". Looks like version incompatibility with the ffi gem? Any ideas?

INFO environment: Loading plugin from JSON: vagrant-chef-zero ERROR root: Failed to load plugin: vagrant-chef-zero ERROR root: -- Error: #Gem::LoadError: Unable to activate chef-11.10.0-x86-mingw32, because ffi-1.9.3-x86-mingw32 conflicts with ffi (= 1.5.0) ERROR root: -- Backtrace: ERROR root: C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/specification.rb:2007:in raise_if_conflicts' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/specification.rb:1176:inactivate' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/specification.rb:1212:in block in activate_dependencies' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/specification.rb:1198:ineach' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/specification.rb:1198:in activate_dependencies' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/specification.rb:1180:inactivate' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems.rb:186:in rescue in try_activate' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems.rb:183:intry_activate' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:117:in rescue in require' C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:124:inrequire' C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant.rb:204:in require_plugin' C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/environment.rb:760:inblock in load_plugins' C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/environment.rb:751:in each' C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/environment.rb:751:inload_plugins' C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/environment.rb:132:in initialize' C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.4.3/bin/vagrant:105:innew' C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.4.3/bin/vagrant:105:in <top (required)>' C:/HashiCorp/Vagrant/bin//../embedded/../embedded/gems/bin/vagrant:23:inload' C:/HashiCorp/Vagrant/bin//../embedded/../embedded/gems/bin/vagrant:23:in `

' INFO interface: error: Failed to load the "vagrant-chef-zero" plugin. View logs for more details.

Failed to load the "vagrant-chef-zero" plugin. View logs for more details.