NOTE: the question was edited to reflect the issue.
i would like to work with
resp = knife_capture :search, ['*:*']
gems/knife-api-0.1.7/lib/knife/api.rb:41:in `ensure in knife_capture': undefined local variable or method `revert_io_channels' for X::Y::Z (NameError)
In a complete non-answer, do not use the
knife-api gem. It should not exist. The correct gem to use if you want to access Chef API data from Ruby code is
chef-api (I know, we're real creative with names). If you want to do something very small, check out the
knife exec command which just exposes the raw Chef object API (not as refined as
chef-api, but built in).