如何防止 Capistrano 在部署时显示密码

How to prevent Capistrano from displaying password when deploying

我最近开始使用 Capistrano 部署我的 rails 应用程序,但我似乎无法弄清楚如何在部署应用程序时提示我输入密码时不显示我的密码。

我收到以下警告,

Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text.

我安装了这两个 gem,但我的密码仍然以明文形式回显。任何帮助将不胜感激。

将此添加到 config/deploy/production.rb

set :ssh_options, {
  keys: %w(/Users/artemadamcov/.ssh/id_rsa),
  forward_agent: true,
  auth_methods: %w(publickey password),
  port: 4321
}

并在终端输入

ssh-add ~/.ssh/id_rsa