Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Error defining private method #4

Closed
danieljimenez opened this issue Aug 31, 2015 · 9 comments
Closed

Error defining private method #4

danieljimenez opened this issue Aug 31, 2015 · 9 comments

Comments

@danieljimenez
Copy link

Build currently fail

TypeError
---------
#<Proc:0x007f952784bd40@/Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:139 (lambda)> is not a symbol

Cookbook Trace:
---------------
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:139:in `private'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:139:in `language_command_mixin'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:152:in `block in <module:Resource>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise/files/halite_gem/poise/utils.rb:148:in `instance_exec'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise/files/halite_gem/poise/utils.rb:148:in `block (3 levels) in parameterized_module'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/python_command_mixin.rb:30:in `include'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/python_command_mixin.rb:30:in `<module:Resource>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/python_command_mixin.rb:29:in `<module:PythonCommandMixin>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/python_command_mixin.rb:25:in `<module:PoisePython>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/python_command_mixin.rb:21:in `<top (required)>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/resources/pip_requirements.rb:21:in `<top (required)>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/resources.rb:17:in `<top (required)>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/files/halite_gem/poise_python/cheftie.rb:17:in `<top (required)>'
  /Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-python/libraries/default.rb:19:in `<top (required)>'

Relevant File Content:
----------------------
/Users/djimenez/Development/ForeFlight/web/.bundle/librarian-chef/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:

132:  
133:              # Create the main accessor for the parent/path.
134:              define_method(name) do |val=Poise::NOT_PASSED|
135:                language_command_runtime(name, runtime, val)
136:              end
137:  
138:              # Create the method to inherit settings from another resource.
139>>             private define_method(:"#{name}_from_parent") { |resource|
140:                language_command_runtime_from_parent(name, resource)
141:              }
142:            end
143:  
144:            # @api private
145:            def included(klass)
146:              super
147:              klass.extend(ClassMethods)
148:            end
@coderanger
Copy link
Member

What version of Ruby is this running on? The cookbook has no specific support for OS X right now but this failure isn't related to that.

@coderanger coderanger changed the title Support for Mac OS X Error defining private method Aug 31, 2015
@coderanger
Copy link
Member

Looks like this was a change between Ruby 2.0 and 2.1, went from returning the body proc to the symbol. If you run using the Ruby 2.1 that comes with the Chef packages, it should work. I'll fix it in the next version of poise-languages.

coderanger added a commit to poise/poise-languages that referenced this issue Aug 31, 2015
Reported in poise/poise-python#4

Ruby 2.0 returns the body proc, not the symbol. Some day I can revert
this if and when I don't want to support Ruby 2.0.
@danieljimenez
Copy link
Author

Any suggestions on how to get this to work in the mean time? I referenced github in both my Gemfile and my Cheffile.

@coderanger
Copy link
Member

You need master of poise-languages, not poise-python. With that it should work again.

@danieljimenez
Copy link
Author

Correct, I was trying that. :(

@danieljimenez
Copy link
Author

Gemfile:
gem 'poise-languages', github: 'poise/poise-languages'

Cheffile:
cookbook 'poise-languages', gem: 'poise-languages

@coderanger
Copy link
Member

Oh, Cheffile meaning librarian? There is no support for Halite and Librarian that I'm aware of. I wrote a Berkshelf extension which you could use.

@danieljimenez
Copy link
Author

Will do, thanks :)

@coderanger
Copy link
Member

If you want to use it with Librarian you can always do the conversion manually. Clone the poise-languages repo, bundle install to get the deps, rake build to run the conversion, and then point librarian at ./pkg/poise-languages-1.1.0.pre.

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