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

undefined method `verbose=' for #<Logger: #109

Closed
johntdyer opened this issue Mar 11, 2013 · 8 comments
Closed

undefined method `verbose=' for #<Logger: #109

johntdyer opened this issue Mar 11, 2013 · 8 comments

Comments

@johntdyer
Copy link

I am playing around w/ Chefspec and I am having a bit of trouble getting this to work.

I am constantly getting an undefined method

let(:chef_run) { ChefSpec::ChefRunner.new.converge 'prism::default' }
    it "should install foo" do
        chef_run.should install_package 'foo'
    end
end

And here is my error:

 Failure/Error: chef_run = ChefSpec::ChefRunner.new
 NoMethodError:
   undefined method `verbose=' for #<Logger:0x007fe3ad8386d0>

I dont see where logger is getting called in

Not sure what I am doing wrong here, any help would be appreciated. Thanks!

-John

@sethvargo
Copy link
Contributor

@johntdyer I think this is actually a Chef issue. What version of Chef are you running (knife -v).

@johntdyer
Copy link
Author

10.16.2

@sethvargo
Copy link
Contributor

What does your knife.rb file look like? What version of ChefSpec?

@johntdyer
Copy link
Author

I was following a blog somewhere to get this working and they suggested putting a knife.rb in the cookbook

./test/.chef/knife.rb

The contents of this file are

cache_type 'BasicFile'
cache_options(:path => "#{ENV['HOME']}/.chef/checksums")

According to my Gemfile.lock the version is only 0.0.1

11:49:29 (development) jdyer@dyer-4.local prism master gem list chefspec

*** LOCAL GEMS ***

chefspec (0.0.1)

@johntdyer
Copy link
Author

I am not sure how I ended up w/ 0.0.1, but I can see its older then dirt :)

I see the GA is currently 0.9.0 but there is a 1.0.0.rc1, which in your opinion should I run w/ ?

@sethvargo
Copy link
Contributor

If you're using chef 11, you need rc1.

@johntdyer
Copy link
Author

Seth,

We are still on 10 right now. We have had to many things in flight to risk the change right now. When CHEF-3356 is merged it will be motivation enough for us to make the switch to 11.

-John

@sethvargo
Copy link
Contributor

Then you're safe to use 0.9.0. Chef 11 changed the way classes are arranged so now there's ugly conditional logic based of Chef::VERSION in the RC that will need to stick around until Chef 10 is deprecated.

When you move to Chef 11, you'll need to test with chefspec >= 1.0.0.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants