状況
以下のようになります*1。
(省略) DEBUG : Executing `sudo -H -u foobar -- /bin/sh -c cd\ \~foobar\ \;\ cd\ /home/foobar/.rbenv\ \&\&\ git\ checkout\ bash:\\\ warning:\\\ setlocale:\\\ LC_ALL:\\\ cannot\\\ change\\\ locale\\\ \\\(ja_JP.UTF-8\\\)\'' '\'483e7f9bdf618ad25af6cab566982e1165274d99\ -b\ deploy`... DEBUG : stdout | bash: warning: setlocale: LC_ALL: cannot change locale (ja_JP.UTF-8) DEBUG : stdout | fatal: 'bash: warning: setlocale: LC_ALL: cannot change locale (ja_JP.UTF-8) DEBUG : stdout | 483e7f9bdf618ad25af6cab566982e1165274d99' is not a commit and a branch 'deploy' cannot be created from it (省略)
どうするか
こんな感じのレシピを予め実行すれば OK でした。sudo
はパスなしで実行できる環境*2です。
%w(language-pack-ja language-pack-ja-base).each do |pkg| package pkg do action :install end end execute 'update locale to ja' do command 'sudo update-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"' end execute 'Change Timezone to Asia/Tokyo' do command 'sudo timedatectl set-timezone Asia/Tokyo' end execute '. /etc/default/locale' do action :run end