.zshrc
rbenvやwheneverなどはbashを前提として説明してあるので、zshに切り替えた場合そのままでは機能しない
# .zshrcへ追加
export PATH=$HOME/.rbenv/shims:$PATH
if which rbenv > /dev/null; then eval "$(rbenv init - zsh)"; fi
"$(rbenv init - zsh)"がポイント
rbenv
変更点なし
crontab
# crontab -e で編集して以下をファイル先頭に追加
SHELL=/path/to/your/zsh # which zsh のパス
cronのデフォルトのSHELLは/bin/shなので変更する
whenever
デフォルトのjob typeはこちら
set :job_template, "bash -l -c ':job'"
job_type :command, ":task :output"
job_type :rake,    "cd :path && :environment_variable=:environment bundle exec rake :task --silent :output"
job_type :runner,  "cd :path && bin/rails runner -e :environment ':task' :output"
job_type :script,  "cd :path && :environment_variable=:environment bundle exec script/:task :output
config/schedule.rbの中で次のものだけ上書きする
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
# Example:
# ...
# ...
# ...
set      :job_template, "source $HOME/.zshrc; $(which zsh) -l -c ':job'"
job_type :runner,       "cd :path && bundle exec rails runner -e :environment ':task' :output"
.zshrcをソースして、シェルをzshがインストールされているパス$(which zsh)で指定し、さらにrunnerはbundle exec rails ...へ変更
これにてタイトルのようなエラーが回避出来る