Ruby on Rails – Capistrano中如何使用rvmsudo进行安全部署?

2026-04-11 17:541阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计208个文字,预计阅读时间需要1分钟。

Ruby on Rails – Capistrano中如何使用rvmsudo进行安全部署?

Capistrano在deploy.rb中无法与rvmsudo一起使用。尝试设置:set :sudo, 'rvmsudo',并将sudo_prompt设置为'password: '后,执行命令:sudo god -c config/unicorn.god --log-level debug,但Capistrano卡在密码提示上。这个问题的解决方案是...

Capistrano在我的deploy.rb中不能与rvmsudo一起使用.

我试过了

set :sudo, 'rvmsudo' set :sudo_prompt, 'password: '

然后运行命令:

sudo "god -c config/unicorn.god --log-level debug"

但Capistrano卡在密码提示上.

Ruby on Rails – Capistrano中如何使用rvmsudo进行安全部署?

这个解决方案here说使用sudo“whoami”然后rvmsudo因为它会记住你的密码5分钟,但我的密码不会被记住.

背景:

desc "Start unicorn" task :start, :except => { :no_release => true } do sudo "god -c config/unicorn.god --log-level debug" end 你在做什么

require 'bundler/capistrano'

它的hacky,但你可以尝试:

after "deploy:update_code", :do_bundle_install task :do_bundle_install do run "cd #{current_release} && rvmsudo bundle install --gemfile #{current_release}/Gemfile --path {path to install}/bundle --without development test cucumber" end

本文共计208个文字,预计阅读时间需要1分钟。

Ruby on Rails – Capistrano中如何使用rvmsudo进行安全部署?

Capistrano在deploy.rb中无法与rvmsudo一起使用。尝试设置:set :sudo, 'rvmsudo',并将sudo_prompt设置为'password: '后,执行命令:sudo god -c config/unicorn.god --log-level debug,但Capistrano卡在密码提示上。这个问题的解决方案是...

Capistrano在我的deploy.rb中不能与rvmsudo一起使用.

我试过了

set :sudo, 'rvmsudo' set :sudo_prompt, 'password: '

然后运行命令:

sudo "god -c config/unicorn.god --log-level debug"

但Capistrano卡在密码提示上.

Ruby on Rails – Capistrano中如何使用rvmsudo进行安全部署?

这个解决方案here说使用sudo“whoami”然后rvmsudo因为它会记住你的密码5分钟,但我的密码不会被记住.

背景:

desc "Start unicorn" task :start, :except => { :no_release => true } do sudo "god -c config/unicorn.god --log-level debug" end 你在做什么

require 'bundler/capistrano'

它的hacky,但你可以尝试:

after "deploy:update_code", :do_bundle_install task :do_bundle_install do run "cd #{current_release} && rvmsudo bundle install --gemfile #{current_release}/Gemfile --path {path to install}/bundle --without development test cucumber" end