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

1.7.1 OSX 10.10 ArgumentError #4962

Closed
Spechal opened this issue Dec 13, 2014 · 26 comments
Closed

1.7.1 OSX 10.10 ArgumentError #4962

Spechal opened this issue Dec 13, 2014 · 26 comments

Comments

@Spechal
Copy link

Spechal commented Dec 13, 2014

OSX Yosemite
VirtualBox 4.3.20
Guest OS Ubuntu 14.10.1
Guest Additions installed

$ vagrant package --base ubuntu-vagrant
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/machine.rb:153:in `action': wrong number of arguments (2 for 1) (ArgumentError)
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in `package_vm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:66:in `package_base'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant:174:in `<main>'
@itaruru
Copy link

itaruru commented Dec 13, 2014

I installed vagrant from dmg on mac.
and change this line.

/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/machine.rb:153

-     def action(name, **opts)
+     def action(name, opts)

thank you.

@Spechal
Copy link
Author

Spechal commented Dec 13, 2014

Resolved my issue. Thank you.

@sethvargo
Copy link
Contributor

@Spechal @itaruru can you please run /opt/vagrant/embedded/bin/ruby -v and show the output?

@sethvargo
Copy link
Contributor

Also, this is also a duplicate of #4960 - could you please respond there?

@danvaida
Copy link

@itaruru +1 thanks!

@rkasigi
Copy link

rkasigi commented Dec 15, 2014

thanks @itaruru . It's work for me!

@sethvargo
Copy link
Contributor

This is fixed in master

@itaruru
Copy link

itaruru commented Dec 15, 2014

@sethvargo thank you!

@wayne-o
Copy link

wayne-o commented Dec 17, 2014

Worked for me!

@lu-chi
Copy link

lu-chi commented Dec 18, 2014

@itaruru +1 - it works on Ubuntu 14.04.

@ghost
Copy link

ghost commented Dec 22, 2014

Removing ** worked great! ;)

@applefreak
Copy link

Had the same problem, works after removing **

@symgryph
Copy link

Works with yosemite, ruby 2.1.5

@sethvargo
Copy link
Contributor

Hi, please do not remove the ** as it could damage your Vagrant installation and make the upgrade process difficult in the future. Here is the actual fix: f9eff24

@symgryph
Copy link

symgryph commented Jan 1, 2015

I tried the fix still get the following:

vagrant package --base CentosBase6.6 --output centostest.box

/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in
`core#hash_merge_kwd': wrong argument type String (expected Symbol)
(TypeError)

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in
`package_vm'

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:66:in
`package_base'

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:42:in
`execute'

from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/cli.rb:42:in
`execute'

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/environment.rb:301:in
`cli'

from
/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant:174:in
`

'

Reverting back to 'working' dangerous fix.....sadness'

On Wed, Dec 31, 2014 at 5:53 PM, Seth Vargo notifications@github.com
wrote:

Hi, please do not remove the ** as it could damage your Vagrant
installation and make the upgrade process difficult in the future. Here is
the actual fix: f9eff24
f9eff24


Reply to this email directly or view it on GitHub
#4962 (comment).


Two Wheels Good, Four Wheels Bad

@symgryph
Copy link

symgryph commented Jan 1, 2015

I just went back to 1.6.5, since it works. I did check out the github
version, and got the same error.

On Thu, Jan 1, 2015 at 4:15 PM, Thomas Munn symgryph@gmail.com wrote:

I tried the fix still get the following:

vagrant package --base CentosBase6.6 --output centostest.box

/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in
`core#hash_merge_kwd': wrong argument type String (expected Symbol)
(TypeError)

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in
`package_vm'

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:66:in
`package_base'

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:42:in
`execute'

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/cli.rb:42:in
`execute'

from
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/environment.rb:301:in
`cli'

from
/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant:174:in
`

'

Reverting back to 'working' dangerous fix.....sadness'

On Wed, Dec 31, 2014 at 5:53 PM, Seth Vargo notifications@github.com
wrote:

Hi, please do not remove the ** as it could damage your Vagrant
installation and make the upgrade process difficult in the future. Here is
the actual fix: f9eff24
f9eff24


Reply to this email directly or view it on GitHub
#4962 (comment).


Two Wheels Good, Four Wheels Bad


Two Wheels Good, Four Wheels Bad

@AntonioMeireles
Copy link

fwiw exact same issue as @symgryph here (10.10.1 && vagrant 1.7.1 && f9eff24 applied)

cd box; \
    vagrant package --base "CoreOS Box" --output ../coreos.box --include change_host_name.rb,configure_networks.rb --vagrantfile vagrantfile.tpl
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in `core#hash_merge_kwd': wrong argument type String (expected Symbol) (TypeError)
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in `package_vm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:66:in `package_base'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant:174:in `<main>'
make: *** [coreos.box] Error 1

@alu
Copy link

alu commented Jan 5, 2015

I think need symbol key in hash.

      def package_vm(vm, options)
        opts = options.inject({}) do |acc, data|
          k,v = data
          acc["package.#{k}".to_sym] = v
          acc
        end

        vm.action(:package, **opts)
      end

@AntonioMeireles
Copy link

humm. issue seems to be https://bugs.ruby-lang.org/issues/10118 if i'm understanding things correctly

@sramazzina
Copy link

Worked for me thanks!!

@AntonioMeireles
Copy link

@sramazzina fwiw it doesn't seem to work that well here. it stops failing but custom args to vagrant package are silently ignored...

@sramazzina
Copy link

I was trying to simply package my ubuntu vm and it worked.... but I was so excited that I made the changes before coming to post's end :-( .... That's my mistake! I reverted the change to the original version. Someone can tell me if the packaged box can be considered as good or do I have to throw it away?

@alu
Copy link

alu commented Jan 6, 2015

@AntonioMeireles Sorry, my comment was not perfectly.

@tian-xiaobo
Copy link

vi vagrant-1.7.1/lib/vagrant/machine.rb:153

def action(name, **opts) to def action(name, opts)

@AntonioMeireles
Copy link

fwiw 1.7.2, released in last few hours, seems to have fixed this once and for all out of the box 😄

@rsvalerio
Copy link

Same problem here.

Environment: vagrant 1.7.2, ruby 2.0.0p481, OSX Yosemite - 10.10.3

Changed file: vi vagrant-1.7.2/lib/vagrant/machine.rb:153

before: def action(name, opts=nil)

after: def action(name, opts)

Done. Thanks to @tian-xiaobo

@hashicorp hashicorp locked and limited conversation to collaborators Apr 8, 2020
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