Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No matching version found for 'XXX' in your gem environment. #1015

Open
KIVagant opened this issue Oct 2, 2021 · 0 comments
Open

No matching version found for 'XXX' in your gem environment. #1015

KIVagant opened this issue Oct 2, 2021 · 0 comments

Comments

@KIVagant
Copy link

KIVagant commented Oct 2, 2021

Hi.

I would like to ask for some help to understand why I see tons of logs like this in rspec results even though tests pass well:

No matching version found for 'aws-sdk-ssm' in your gem environment.
 - if you are using ChefDK, run the following command: "chef gem install aws-sdk-ssm --version '~> 1.46.0'"
 - if you are using bundler, append "gem 'aws-sdk-ssm', '~> 1.46.0'" to your Gemfile and run "bundle install"
 - otherwise run: "gem install aws-sdk-ssm --version '~> 1.46.0'"

Trying to get rid of the log messages I used different versions of ChefDK from 3.0 to 4.9.17. Also, I tested every possible combination of commands trying to reduce the noise in logs, including:

  • updating all 'metadata.rb' files adding gem 'XXXX', '~> X.X.X';
  • running chef exec bundle config set system true or bundle config set system true before installing gems;
  • running chef exec bundle install;
  • running bundle install;
  • running chef gem install xxx -v '~> X.X.X' for every dependency before running rspec

In addition, I checked $PATH to make sure Ruby is configured properly. And I used bundle info xxx (or chef exec bundle info xxx) to make sure the Gem is installed.

Nothing helped to remove the errors.

What am I doing wrong and how to remove the message?

Test example:

require 'spec_helper'

describe 'cloudwatch_logs::default' do
  cached(:chef_run) do
    ChefSpec::SoloRunner.new do |node|
      node.default['languages'] = { 'python' => { 'version' => '2.7.1' } }
    end.converge(described_recipe)
  end

  it 'includes the  `aws-cloudwatchlogs` recipe' do
    expect(chef_run).to include_recipe('aws-cloudwatchlogs')
  end
end

The cookbook has depends 'aws', '= 8.4.1' in metadata.rb.

I'm not an expert in Chef cookbooks, especially in testing. So I admit the possibility that I need to write tests somehow differently to make it work properly.

Appreciate any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant