当前位置 : 主页 > 编程语言 > ruby >

ruby-on-rails – Capistrano rvmsudo

来源:互联网 收集:自由互联 发布时间:2021-06-23
Capistrano在我的deploy.rb中不能与rvmsudo一起使用. 我试过了 set :sudo, 'rvmsudo'set :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卡在密码提示上.

这个解决方案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
网友评论