はじめに Ruby製のデプロイツールであるCapistranoを使ってみました。いろいろなレシピを眺めていると、sudoの書き方が次のようにいろいろあって違いがわからなかったので、調べてみました。 sudo "hoge" # (1) sudoアクション run "sudo hoge" # (2) 文字列 "sudo" run "#{sudo} hoge" # (3) 文字列 "#{sudo}" run "#{try_sudo} huge" # (4) 文字列 "#{try_sudo}" なお、対象のバージョンは、執筆時点で最新の2.14.2です。 (1) sudoアクション この書き方は、deprecatedなので今は使いません。 2.x DSL Action Invocation Sudo · capistrano/capistrano Wik