简体   繁体   English

Capistrano 部署引发心理错误:arguments 的编号错误(给定 4,预期为 1):`safe_load'

[英]Capistrano deployment throws psych error: wrong number of arguments (given 4, expected 1) :`safe_load'

On my local machine the project works perfectly fine.在我的本地机器上,该项目运行良好。 Bundle install works fine and I can run the project locally.捆绑安装工作正常,我可以在本地运行项目。 Till now, all my deployments were also working fine.到目前为止,我所有的部署也都运行良好。 But starting this deployment (no changes to any of the gems or even the code), even without changing existing code in any way, the deployment started breaking on bundle install with below error ->但是开始这个部署(没有更改任何 gem 甚至代码),即使没有以任何方式更改现有代码,部署开始在捆绑安装时中断,并出现以下错误 ->

Rails -> '5.0.7.2'
Ruby -> 2.5.3
Bundler             1.16.6
Deployment Tool -> Capistrano '3.11.0'

#<Thread:0x00007f9f6013bd00@/home/myusername/.rvm/gems/ruby-2.5.3/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 1: from /home/myusername/.rvm/gems/ruby-2.5.3/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in block (2 levels) in execute' /home/myusername/.rvm/gems/ruby-2.5.3/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in rescue in block (2 levels) in execute': Exception while executing as ruby@10.38.212.234: cd /var/www/portal.myapplication.com/releases/20220119150641; #<Thread:0x00007f9f6013bd00@/home/myusername/.rvm/gems/ruby-2.5.3/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> 异常终止(report_on_exception 为真):回溯(最近一次通话最后):1:来自/home/myusername/.rvm/gems/ruby-2.5.3/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in block (2 levels) in execute' /home/myusername/.rvm/gems/ruby-2.5.3/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in块中的救援(2级别)在执行':执行为 ruby@10.38.212.234 时出现异常:cd /var/www/portal.myapplication.com/releases/20220119150641; /usr/local/rvm/gems/ruby-2.5.3/wrappers/bundle install exit status: 1 (SSHKit::Runner::ExecuteError) cd /var/www/portal.myapplication.com/releases/20220119150641; /usr/local/rvm/gems/ruby-2.5.3/wrappers/bundle 安装退出状态:1 (SSHKit::Runner::ExecuteError) cd /var/www/portal.myapplication.com/releases/20220119150641; /usr/local/rvm/gems/ruby-2.5.3/wrappers/bundle install stdout: Fetching gem metadata from https://rubygems.org/....... . /usr/local/rvm/gems/ruby-2.5.3/wrappers/bundle install stdout: Fetching gem metadata from https://rubygems.org/.......

ArgumentError: wrong number of arguments (given 4, expected 1)

/usr/local/rvm/gems/ruby-2.5.3/gems/psych-4.0.3/lib/psych.rb:323:in safe_load' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/safe_yaml.rb:31:in safe_load' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:486:in block (2 levels) in read_checksums' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:485:in wrap' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:485:in block in read_checksums' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package/tar_reader.rb:116:in seek' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:484:in read_checksums' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:537:in block (2 levels) in verify' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package/tar_reader.rb:29:in new' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:536:in block in verify' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package/file_sour /usr/local/rvm/gems/ruby-2.5.3/gems/psych-4.0.3/lib/psych.rb:323:in safe_load' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/safe_yaml.rb:31:in safe_load' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:486:in block (2 levels) in read_checksums' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:485:in wrap'/usr/local/rvm/rubies /ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:485:in block in read_checksums' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package/tar_reader.rb:116:in seek' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:484:in read_checksums' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:537:in block (2 levels) in verify' /usr/local/rvm/rubies/ruby-2.5 .3/lib/ruby/2.5.0/rubygems/package/tar_reader.rb:29:in new' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:536:in block in verify' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package/file_sour ce.rb:30:in open' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package/file_source.rb:30:in with_read_io' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:535:in verify' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:516:in spec' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/rubygems_integration.rb:307:in spec_from_gem' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:368:in block in cached_specs' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:366:in each' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:366:in cached_specs' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:90:in specs' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:274:in block (2 levels) in index' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:272:in each' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:272:in ce.rb:30:in open' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package/file_source.rb:30:in with_read_io' /usr/local/ rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:535:in verify' /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/package.rb:516:in spec' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/rubygems_integration.rb:307:in spec_from_gem' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:368:in block in cached_specs' /usr/local/rvm/gems/ruby- 2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:366:in each' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:366:in cached_specs' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/source/rubygems.rb:90:在specs' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:274:in block (2 levels) in index'/usr/local/ rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:272:in each' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:272:in each' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:272:in block in index' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/index.rb:11:in build' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:269:in index' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:259:in resolve' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:171:in specs' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:159:in resolve_remotely.' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/installer:rb:287:in each' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:272:in block in index' /usr/local/rvm/gems/ruby-2.5。 3/gems/bundler-1.16.6/lib/bundler/index.rb:11:in build' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:269:in index' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:259:in resolve' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/definition.rb:171:in specs' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler- 1.16.6/lib/bundler/definition.rb:159:in resolve_remotely.' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/installer:rb:287:in resolve_remotely.' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/installer:rb:287:in resolve_if_needed' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/installer.rb:83:in block in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/process_lock.rb:12:in block in lock' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/process_lock.rb:9:in open' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/process_lock.rb:9:in lock' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/installer.rb:72:in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bun DEBUG [93166736] dler-1.16.6/lib/bundler/installer.rb:25:in install' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli/install.rb:65:in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:224:in block in install' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/settings.rb:136:in temporary' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:223:in resolve_remotely.' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/installer:rb:287:in resolve_if_needed' /usr/local/rvm/gems/ruby-2.5.3 /gems/bundler-1.16.6/lib/bundler/installer.rb:83:in block in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/process_lock.rb:12:in block in lock' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/process_lock.rb:9:in open' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/process_lock.rb:9:in lock' /usr/local/rvm/gems/ruby-2.5.3/gems /bundler-1.16.6/lib/bundler/installer.rb:72:in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bun DEBUG [93166736] dler-1.16.6/lib/bundler/installer.rb:25:in install' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli/install.rb:65:in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:224:in block in install' /usr/local/rvm/gems/ruby-2.5. 3/gems/bundler-1.16.6/lib/bundler/settings.rb:136:in temporary' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:223:in temporary' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:223:in install' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:27:in dispatch' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:18:in start' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/exe/bundle:30:in block in <top (required)>' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/friendly_errors.rb:124:in with_friendly_errors' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/exe/bundle:22:in <top (required)>' /usr/local/rvm/gems/ruby-2.5.3/bin/bundle:23:in load' /usr/local/ temporary' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:223:in install' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/ command.rb:27:in run' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command'/usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:27:in dispatch' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler- 1.16.6/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/cli.rb:18:in start' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/exe/bundle:30:in block in <top (required)>' /usr/local/rvm/gems/ruby-2.5.3/gems/bundler-1.16.6/lib/bundler/friendly_errors.rb:124:in with_friendly_errors' /usr/local/rvm/gems/ruby-2.5.3 /gems/bundler-1.16.6/exe/bundle:22:in <top (required)>' /usr/local/rvm/gems/ruby-2.5.3/bin/bundle:23:in load' /usr/当地的/ rvm/gems/ruby-2.5.3/bin/bundle:23:in <main>' /usr/local/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in eval' /usr/local/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `' rvm/gems/ruby-2.5.3/bin/bundle:23:in <main>' /usr/local/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in eval' /usr/local/ rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `'

Solution: I looked for the Gem that is adding Psych Gem (it is not listed in Gemfile directly).解决方案:我寻找添加 Psych Gem 的 Gem(它没有直接列在 Gemfile 中)。 Then I restricted that parent Gem's version to previous version that does not download Psych.然后我将该父 Gem 的版本限制为不下载 Psych 的先前版本。 Then I ran gem uninstall psych on the server where I was deploying the code.然后我在部署代码的服务器上运行gem uninstall psych Removed all versions of Psych from that server.从该服务器中删除了所有版本的 Psych。 Then the deployment worked fine.然后部署工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM