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

Upgrading Ruby version 3.0.2 getting wrong number of arguments (given 2, expected 0..1) (SSHKit:: runner ::ExecuteError) #2091

Closed
mohitmchavda opened this issue Oct 18, 2021 · 3 comments

Comments

@mohitmchavda
Copy link

mohitmchavda commented Oct 18, 2021

We have updated existing project to Ruby 3.0.2 and Rails 6.1.4.1.
After updating, when try to deploy the code, system raise the error of wrong number of argument and failed to deploy.

Following is existing configuration:

Used gem file:

gem 'capistrano', '~> 3.4.0'
gem 'capistrano-bundler', '~> 1.1.4'
gem 'capistrano-rails', '~> 1.1.6'
gem 'capistrano-rvm', github: "capistrano/rvm"
gem 'capistrano-faster-assets', '~> 1.0'
gem 'slackistrano'

Cap file:

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/rvm'
require 'slackistrano/capistrano'
require 'whenever/capistrano'
set :rvm_type, :system
set :rvm_ruby_version, '3.0.2'
#set :rvm_ruby_version, '2.3.1' #old version

Please provide any view to track the issue or how to track it and solve it.

Error log:

#<Thread:0x0000000001f16520 /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
/home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as serveruser@xx.xx.x.xx: wrong number of arguments (given 2, expected 0..1) (SSHKit::runner::ExecuteError)
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/i18n-1.8.10/lib/i18n.rb:196:in `translate': wrong number of arguments (given 2, expected 0..1) (ArgumentError)
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/dsl.rb:20:in `t'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/tasks/git.rake:37:in `block (3 levels) in <top (required)>'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::runner::ExecuteError: Exception while executing as serveruser@xx.xx.x.xx: wrong number of arguments (given 2, expected 0..1)
Caused by:
ArgumentError: wrong number of arguments (given 2, expected 0..1)
Tasks: TOP => git:create_release => git:update => git:clone
(See full trace by running task with --trace)
bundler: failed to load command: cap (/home/test/.rbenv/versions/3.0.2/bin/cap)
/home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/i18n-1.8.10/lib/i18n.rb:196:in `translate': wrong number of arguments (given 2, expected 0..1) (ArgumentError)
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/dsl.rb:20:in `t'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/dsl/task_enhancements.rb:56:in `exit_deploy_because_of_exception'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/application.rb:78:in `exit_because_of_exception'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:196:in `rescue in standard_exception_handling'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:185:in `standard_exception_handling'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/application.rb:15:in `run'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/bin/cap:3:in `<top (required)>'
        from /home/test/.rbenv/versions/3.0.2/bin/cap:23:in `load'
        from /home/test/.rbenv/versions/3.0.2/bin/cap:23:in `<top (required)>'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `load'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `kernel_load'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/cli/exec.rb:28:in `run'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/cli.rb:474:in `exec'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/cli.rb:30:in `dispatch'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/cli.rb:24:in `start'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.22/libexec/bundle:49:in `block in <top (required)>'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/3.0.0/bundler/friendly_errors.rb:128:in `with_friendly_errors'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.22/libexec/bundle:37:in `<top (required)>'
        from /home/test/.rbenv/versions/3.0.2/bin/bundle:23:in `load'
        from /home/test/.rbenv/versions/3.0.2/bin/bundle:23:in `<main>'
/home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as serveruser@xx.xx.x.xx: wrong number of arguments (given 2, expected 0..1) (SSHKit::runner::ExecuteError)
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/i18n-1.8.10/lib/i18n.rb:196:in `translate': wrong number of arguments (given 2, expected 0..1) (ArgumentError)
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/dsl.rb:20:in `t'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/capistrano-3.4.1/lib/capistrano/tasks/git.rake:37:in `block (3 levels) in <top (required)>'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
        from /home/test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'

@mohitmchavda mohitmchavda changed the title Upgrading Ruby version 3.0.2 getting wrong number of arguments (given 2, expected 0..1) (SSHKit::runner::ExecuteError) Upgrading Ruby version 3.0.2 getting wrong number of arguments (given 2, expected 0..1) (SSHKit:: runner ::ExecuteError) Oct 18, 2021
@mohitmchavda
Copy link
Author

syntax is break in capistrano dsl.rb when i18n syntax called. i18n version is 1.8.10

def t(key, options={})
      I18n.t(key, options.merge(scope: :capistrano))
    end

is it the cause ? or what are the argument based on new ruby upgrade?

@mattbrictson
Copy link
Member

Hi @mohitmchavda, I believe this was fixed in capistrano 3.14.1. Can you upgrade your capistrano version and try again?

@mattbrictson
Copy link
Member

Assuming this has been resolved. Closing.

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