如何在Capistrano的运行命令中将shell设置为使用bash而不是sh? 我正在尝试安装RVM,我需要执行以下命令:
run "bash < <(curl -L http://bit.ly/rvm-install-system-wide)"
如下所示:
task :install_rvm, :roles => :server do
apps = %w(bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev sqlite3 libsqlite3-0 libxml2-dev libxslt-dev autoconf subversion libcurl4-openssl-dev)
apt.install( {:base => apps}, :stable )
run "bash < <(curl -L http://bit.ly/rvm-install-system-wide)"
run "rvm install 1.9.2".sh
run "rvm use 1.9.2@global"
run "gem install awesome_print map_by_method wirble bundler builder pg cheat"
run "gem install -v2.1.2 builder"
# modify .bashrc
end
但是我似乎无法使它工作,因为Capistrano正在执行:
"sh -c 'bash < <(curl -L http://bit.ly/rvm-install-system-wide)'" on ubuntu@ec2...
我在Capistrano gem中看到command.rb文件有一些代码,例如
shell = "#{options[:shell] || "sh"} -c"
但是我不清楚如何将options[:shell]
传递给任务
sh -c
bash ...``执行bash
。这不符合您的要求吗?(免责声明:我对Capistrano一无所知。) - Keith Thompson