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 `first' #23

Open
memelet opened this issue Sep 26, 2012 · 1 comment
Open

undefined method `first' #23

memelet opened this issue Sep 26, 2012 · 1 comment

Comments

@memelet
Copy link

memelet commented Sep 26, 2012

When I run, for example, knife cookbook github -VV install librato/papertrail-cookbook I get the below. I am using ruby 1.9.3-p194. Is this related to http://tickets.opscode.com/browse/CHEF-1532? (BTW, I know very little ruby).

DEBUG: Using configuration from /home/bkaplan/.chef/knife.rb
/home/bkaplan/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/knife-github-cookbooks-0.1.6/lib/chef/knife/cookbook_github_install.rb:72:in run': undefined methodfirst' for "~/si/ops/chef-repo/cookbooks":String (NoMethodError)
from /home/bkaplan/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/knife.rb:402:in run_with_pretty_exceptions' from /home/bkaplan/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/knife.rb:168:inrun'
from /home/bkaplan/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/application/knife.rb:123:in run' from /home/bkaplan/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/chef-10.12.0/bin/knife:25:in<top (required)>'
from /home/bkaplan/.rbenv/versions/1.9.3-p194/bin/knife:23:in load' from /home/bkaplan/.rbenv/versions/1.9.3-p194/bin/knife:23:in

'

@patjenk
Copy link

patjenk commented Nov 6, 2012

In your knife.rb file (home/bkaplan/.chef/knife.rb) your cookbook_path is set to a string instead of an array. For example, it probably looks like

cookbook_path  "/home/bkaplan/mycookbooks"

if you change it to

cookbook_path  ["/home/bkaplan/mycookbooks"]

You'll be able to install cookbooks.

It looks like the opscode documentation for knife (http://wiki.opscode.com/display/chef/Chef+Configuration+Settings) says the cookbook_path value can be an array or string. If you check for the type on line 72 in lib/chef/knife/cookbook_github_install.rb you can fix this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants