sous-chefs/nodejs

uninitialized constant Chef::Mixin::HomebrewUser

Closed this issue · 1 comments

Cookbook version

3.0.0

Chef-client version

11.10.4

Platform Details

Amazon Linux 2016.09

Scenario:

Running a test chef recipe that touches a file

Steps to Reproduce:

Include this cookbook in Berksfile

Expected Result:

Touched file

Actual Result:

================================================================================
Recipe Compile Error in /var/lib/aws/opsworks/cache.stage2/cookbooks/homebrew/libraries/homebrew_mixin.rb
================================================================================
 
 
NameError
---------
uninitialized constant Chef::Mixin::HomebrewUser
 
 
Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/homebrew/libraries/homebrew_mixin.rb:23:in `<class:Chef12HomebrewUser>'
/var/lib/aws/opsworks/cache.stage2/cookbooks/homebrew/libraries/homebrew_mixin.rb:22:in `<top (required)>'
 
 
Relevant File Content:
----------------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/homebrew/libraries/homebrew_mixin.rb:
 
16:  # distributed under the License is distributed on an "AS IS" BASIS,
17:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18:  # See the License for the specific language governing permissions and
19:  # limitations under the License.
20:  #
21:  
22:  class Chef12HomebrewUser
23>>   include Chef::Mixin::HomebrewUser
24:  end
25:  
26:  module Homebrew
27:    # Homebrew
28:    module Mixin
29:      def homebrew_owner
30:        require 'etc'
31:        @homebrew_owner ||= ::Etc.getpwuid(Chef12HomebrewUser.new.find_homebrew_uid).name
32:      rescue Chef::Exceptions::CannotDetermineHomebrewOwner
tas50 commented

You'll need to upgrade your Chef client to 12+ in order to use this cookbook. Chef 12 was released in Dec 2014 and included proper support for Homebrew.