jedi4ever / veewee

Easing the building of vagrant boxes
MIT License
4.29k stars 779 forks source link

`initialize': wrong number of arguments (given 2, expected 0) (ArgumentError) #1103

Closed holms closed 7 years ago

holms commented 7 years ago

I've got this crash when I try to run veewee with existing definition. Definition can be checked here: https://github.com/holms/vagrant-jessie-box

Here's tracelog:

Romans-MacBook-Air:vagrant-jessie-box holms$ veewee vbox build Debian-jessie-amd64-netboot
Downloading vbox guest additions iso v 5.1.20 - http://download.virtualbox.org/virtualbox/5.1.20/VBoxGuestAdditions_5.1.20.iso
Checking if isofile VBoxGuestAdditions_5.1.20.iso already exists.
Full path: /Users/holms/Dev/github/vagrant-jessie-box/iso/VBoxGuestAdditions_5.1.20.iso
/opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:36:in `initialize': wrong number of arguments (given 2, expected 0) (ArgumentError)
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:36:in `new'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:36:in `block in download_progress'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:333:in `block (2 levels) in open_http'
    from /opt/local/lib/ruby2.4/2.4.0/net/http.rb:1455:in `block in transport_request'
    from /opt/local/lib/ruby2.4/2.4.0/net/http/response.rb:165:in `reading_body'
    from /opt/local/lib/ruby2.4/2.4.0/net/http.rb:1454:in `transport_request'
    from /opt/local/lib/ruby2.4/2.4.0/net/http.rb:1416:in `request'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:329:in `block in open_http'
    from /opt/local/lib/ruby2.4/2.4.0/net/http.rb:877:in `start'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:323:in `open_http'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:741:in `buffer_open'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:212:in `block in open_loop'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:210:in `catch'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:210:in `open_loop'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:151:in `open_uri'
    from /opt/local/lib/ruby2.4/2.4.0/open-uri.rb:721:in `open'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:33:in `download_progress'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:26:in `download_iso'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb:11:in `download_vbox_guest_additions_iso'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/provider/virtualbox/box/build.rb:8:in `build'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/lib/veewee/command/vbox.rb:22:in `build'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:115:in `invoke'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor.rb:242:in `block in subcommand'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
    from /opt/local/lib/ruby2.4/gems/2.4.0/gems/veewee-0.4.5.1/bin/veewee:24:in `<top (required)>'
    from /opt/local/bin/veewee:22:in `load'
    from /opt/local/bin/veewee:22:in `<main>'

Specs:

$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
$ gem --version
2.6.11

Before that I had a another problem:

Romans-MacBook-Air:vagrant-jessie-box holms$ veewee vbox build Debian-jessie-amd64-netboot
/opt/local/lib/ruby2.4/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- net/scp (LoadError)
    from /opt/local/lib/ruby2.4/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'

But installing net-scp from gems solved it.

FunTimeCoding commented 7 years ago

I would assume the ruby is too new. I use RVM to install ruby 2.1 for veewee.

cmur2 commented 7 years ago

I'm having the same error with ruby 2.1.1, the tracelog:

$ veewee vbox build Debian-jessie-amd64-netboot
Downloading vbox guest additions iso v 5.1.8 - http://download.virtualbox.org/virtualbox/5.1.8/VBoxGuestAdditions_5.1.8.iso
Creating an iso directory
Checking if isofile VBoxGuestAdditions_5.1.8.iso already exists.
Full path: /home/user/tmp/vagrant-jessie-box/iso/VBoxGuestAdditions_5.1.8.iso
/home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:36:in `initialize': wrong number of arguments (2 for 0) (ArgumentError)
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:36:in `new'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:36:in `block in download_progress'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:323:in `call'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:323:in `block (2 levels) in open_http'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:1415:in `block (2 levels) in transport_request'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http/response.rb:162:in `reading_body'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:1414:in `block in transport_request'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:1405:in `catch'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:1405:in `transport_request'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:1378:in `request'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:319:in `block in open_http'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:853:in `start'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:313:in `open_http'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:724:in `buffer_open'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:210:in `block in open_loop'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:208:in `catch'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:208:in `open_loop'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:149:in `open_uri'
    from /home/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open-uri.rb:704:in `open'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:33:in `download_progress'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/provider/core/helper/iso.rb:26:in `download_iso'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb:11:in `download_vbox_guest_additions_iso'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/provider/virtualbox/box/build.rb:8:in `build'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/lib/veewee/command/vbox.rb:22:in `build'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor/invocation.rb:115:in `invoke'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor.rb:242:in `block in subcommand'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
    from /home/user/.rvm/gems/ruby-2.1.1/gems/veewee-0.4.5.1/bin/veewee:24:in `<top (required)>'
    from /home/user/.rvm/gems/ruby-2.1.1/bin/veewee:23:in `load'
    from /home/user/.rvm/gems/ruby-2.1.1/bin/veewee:23:in `<main>'
    from /home/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
    from /home/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

I also installed net-scp manually. Am I doing something wrong?

cmur2 commented 7 years ago

The problem stems from the gem progressbar that has a new version available from 2016 which is incompatible with the version veewee used to use back in 2014. Manually installing progressbar version 0.21.0 fixed the problem for me.

I use the following Gemfile with bundler now to install veewee with ruby 2.1.1:

source "http://rubygems.org"

gem 'veewee'
gem 'net-scp'
gem 'progressbar', '0.21.0'