electric-it / minimart

MiniMart RubyGem for Chef cookbook mirroring and storage.
Apache License 2.0
52 stars 20 forks source link

Syncing from git #6

Closed pliu closed 9 years ago

pliu commented 9 years ago

When attempting to sync a cookbook from git (using the example given in README.md), I receive the following error message:

/var/lib/gems/1.9.1/gems/git-1.2.6/lib/git/base.rb:335:in fetch': wrong number of arguments (2 for 1) (ArgumentError) from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/download/git_repository.rb:23:inblock in fetch' from /usr/lib/ruby/1.9.1/tmpdir.rb:83:in mktmpdir' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/download/git_repository.rb:21:infetch' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/inventory_requirement/git_requirement.rb:70:in download_cookbook' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/inventory_requirement/base_requirement.rb:45:infetch_cookbook' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_builder.rb:43:in block in install_cookbooks_with_explicit_location' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_requirements.rb:31:incall' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_requirements.rb:31:in block in each_with_explicit_location' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_requirements.rb:26:ineach' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_requirements.rb:26:in each' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_requirements.rb:30:ineach_with_explicit_location' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_builder.rb:42:in install_cookbooks_with_explicit_location' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/mirror/inventory_builder.rb:26:inbuild!' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/commands/mirror.rb:26:in execute!' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/cli.rb:56:inmirror' from /home/minimart/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /home/minimart/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /home/minimart/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /home/minimart/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:instart' from /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/bin/minimart:4:in <top (required)>' from /home/minimart/.gem/ruby/1.9.1/bin/minimart:19:inload' from /home/minimart/.gem/ruby/1.9.1/bin/minimart:19:in `

'

The problem is resolved by removing the second argument from the fetch call on line 23 in /home/minimart/.gem/ruby/1.9.1/gems/minimart-1.0.2/lib/minimart/download/git_repository.rb ("tags: true"). This is because the fetch function in /var/lib/gems/1.9.1/gems/git-1.2.6/lib/git/base.rb only accepts 0 or 1 argument.

I'm kind of a Ruby noob (also in general), so figured I'd just post this as an issue with how I managed to fix it and let you guys look at it more closely since I'm sure I missed something obvious...

tapickell commented 9 years ago

Hi, thank you for this. I am looking into it. Could you try this with a current version of Ruby, 2.0 or newer and post if you have the same issue. Thanks.

richardardrichard commented 9 years ago

It looks like we might need to lock down that gem version. Any version higher than 1.2.6 supports that call.

tapickell commented 9 years ago

will do thank s @richardardrichard

pliu commented 9 years ago

The code works as is with ruby 2.1.5p273.