Failed to find gem json (= 2.0.2) from [https://rubygems.org/]


#1

Hi partners,

I am using chef_gem resource to install JSON gem. It is my code:

# Gem install json
chef_gem 'json' do
  version "2.0.2"
  compile_time false if respond_to?(:compile_time)
  notifies :run, 'ruby_block[Email]', :immediately
end

I installed the gem on multiple nodes but there are two in which get the following error:

[2016-10-18T23:03:26-05:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: chef_gem[json] (download_war::requirements line 15) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of C:/opscode/chef/embedded/bin/gem install json -q --no-rdoc --no-ri -v "2.0.2" ----
STDOUT: 
STDERR: ERROR:  Could not find a valid gem 'json' (= 2.0.2), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/specs.4.8.gz)
---- End output of C:/opscode/chef/embedded/bin/gem install json -q --no-rdoc --no-ri -v "2.0.2" ----
Ran C:/opscode/chef/embedded/bin/gem install json -q --no-rdoc --no-ri -v "2.0.2" returned 2

Any help pls !


#2

Someone has any idea about the above. Why is this happening ?


#3

it might be a stupid question but are you’re node able to connect to these 2 sites? curl https://rubygems.org/ and curl https://api.rubygems.org/specs.4.8.gz