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

Unable to compile the ruby gems #322

Open
tushar35314 opened this issue Jul 12, 2018 · 1 comment
Open

Unable to compile the ruby gems #322

tushar35314 opened this issue Jul 12, 2018 · 1 comment
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@tushar35314
Copy link

tushar35314 commented Jul 12, 2018

Cookbook version

6.0.1

Chef-client version

14.2.0

Platform Details

RHEL 7.5

Scenario:

Trying to have a compliance report based on "DevSec Linux Patch Benchmark"

Steps to Reproduce:

  • Updated the runlist
  • Excuted the chef-client
### Expected Result:
  NameError
  ---------
  inspec_gem[inspec] (audit::inspec line 20) had an error: NameError: undefined local variable or method `version' for #<#<Class:0x00000000041bce08>:0x0000000004086ea8>

  Cookbook Trace:
  ---------------
    /var/chef/cache/cookbooks/audit/resources/inspec_gem.rb:31:in `block (2 levels) in class_from_file'
    /var/chef/cache/cookbooks/audit/resources/inspec_gem.rb:30:in `block in class_from_file'
    /var/chef/cache/cookbooks/audit/recipes/inspec.rb:24:in `from_file'
    /var/chef/cache/cookbooks/audit/recipes/default.rb:30:in `from_file'
    /var/chef/cache/cookbooks/ponit__audit/recipes/default.rb:6:in `from_file'

  Relevant File Content:
  ----------------------
  /var/chef/cache/cookbooks/audit/resources/inspec_gem.rb:

   24:      converge_by 'uninstall all inspec and train gem versions' do
   25:        uninstall_inspec_gem
   26:      end
   27:    end
   28:
   29:    if installation_required
   30:      converge_by 'install latest InSpec version' do
   31>>       install_inspec_gem(version: version, source: source)
   32:      end
   33:    else
   34:      Chef::Log.info("inspec_gem: not installing InSpec. It's already installed or an explicit version was not supplied.")
   35:    end
   36:  end
   37:
   38:  action_class do
   39:    def install_inspec_gem(options)
   40:      gem_source  = options[:source]

  System Info:
  ------------
  chef_version=14.2.0
  platform=redhat
  platform_version=7.5
  ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
  program_name=/bin/chef-client
  executable=/opt/chef/bin/chef-client

Actual Result:

The report should be created without any issue

@nhenjes
Copy link

nhenjes commented Mar 11, 2019

Were you able to resolve your issue? I ran into this today and I suspect is a cookbook vs. client version issue.

What happens if you use either [Chef-Client 12 and Cookbook 6] or [Chef-Client 14 and Cookbook version 7]?

@zenspider zenspider changed the title Unable to complie the ruby gems Unable to compile the ruby gems Oct 14, 2019
@zenspider zenspider added the Status: Untriaged An issue that has yet to be triaged. label Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Development

No branches or pull requests

3 participants