hipchat / hipchat-rb

HipChat HTTP API Wrapper in Ruby with Capistrano hooks

Home Page:https://www.hipchat.com/docs/apiv2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON dependency issue between Chef and HTTParty

rbastian opened this issue · comments

Hi -

Chef 11.8.x has its JSON dependency locked to <= 1.7.7, >= 1.4.4.

Hipchat loads httparty 0.12 by default which has its own JSON dependency locked to ~>1.8.

Because of this when I try to integrate Hipchat into my Chef recipes I'm getting the following exception:

Gem::LoadError

artifact_deploy[entitlements-service](/tmp/vagrant-chef-1/chef-solo-1/cookbooks/play/providers/app.rb line 81) had an error: Gem::LoadError: ruby_block[notify-hipchat](/tmp/vagrant-chef-1/chef-solo-1/cookbooks/entitlements-service/recipes/default.rb line 100) had an error: Gem::LoadError: Unable to activate httparty-0.12.0, because json-1.7.7 conflicts with json (~> 1.8)

Has anybody solved this problem and successfully integrated Hipchat with Chef 11.8.x?

This is not an excellent solution, but I am using it currently:

chef_gem "httparty" do
  version "0.11.0"
end

chef_gem "hipchat" do
  action :nothing
end.run_action(:install)

Gem.clear_paths

Force the install of httparty 0.11.0 first, which allows hipchat to be installed.

I think modifying the gemspec to specify a version of httparty would fix this issue.

The following seemed to have done the trick as well:

chef_gem "httparty" do
  version "0.12.0"
  action :remove 
end 

chef_gem "httparty" do
 version "0.11.0" 
end

chef_gem "hipchat"

In Chef 11.10 the version of json gem was bumped to ">=1.4.4 and <= 1.8.1" and since then has been further updated to switch from json gem to ffi-yajl. This issue can probably be closed.