Rails 6 Capistrano 部署失败:检测到损坏的 hmac

Rails 6 Capistrano Deploy Failing: corrupted hmac detected

我正在尝试使用 Capistrano + Nginx + Puma 部署 Rails 6 应用程序。过去(在那种情况下是 Rail 4)我使用了本教程 https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma 并且效果很好。

但是,当我尝试 运行 cap production deploy:initial(or without the initial namespace) 时,我收到以下错误:The deploy has failed with an error: Exception while executing on host 31.220.51.222: Exception while executing on host 31.220.51.222: corrupted hmac detected ** Invoke deploy:failed (first_time) ** Execute deploy:failed

所以我不确定这是否是 NET::SSH 的问题以及它来自哪里,或者是否是与此消息无关的问题。

以下是启用了 -t 选项的 capistrano.log 的最后几行。

 DEBUG [daa21174] Command: cd /home/deploy/apps/market_backend/releases/20200422204058 && /usr/local/rvm/bin/rvm default do bundle check --path /home/deploy/apps/market_backend/shared/bundle
 DEBUG [daa21174]   [33m[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '/home/deploy/apps/market_backend/shared/bundle'`, and stop using this flag[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [33mThe dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31mThe following gems are missing[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * public_suffix (4.0.4)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * addressable (2.7.0)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * net-ssh (6.0.0)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * net-scp (1.2.1)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * sshkit (1.21.0)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * airbrussh (1.4.0)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * bindex (0.8.1)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * byebug (11.1.2)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * capistrano (3.13.0)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * capistrano-bundler (1.6.0)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * capistrano-rails (1.4.0)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * capistrano-rvm (0.1.2)[0m
 DEBUG [daa21174]   
 DEBUG [daa21174]   [31m * capistrano-yarn (2.0.2)[0m```



The strange thing is that the log suddently finishes without saying anything about the problem.

Does someone has any clue on how to solve this?

这似乎是最新更新版本的 net-ssh gem 的问题,我遇到了同样的问题,降级后它可以正常工作。

你在这里找到它:

https://github.com/net-ssh/net-ssh/issues/728