我需要将我的whenever scheduler的环境设置为所有环境(production、staging和development)
我需要它,因为我想让cron在任何给定的环境中触发。
我知道我可以将环境设置如下:
set :environment, 'staging'或
set :environment, 'development'等
但其中任何一个都只会将环境缺省为指定的。
如何将环境设置为all,以使其在所有情况下都能工作?
谢谢。
发布于 2016-12-22 21:23:23
在部署时,您可以在deploy.rb文件bundle exec whenever --update-crontab --set 'environment=#{rails_env}&path=#{deploy_to}/current/'中像这样设置环境。
https://stackoverflow.com/questions/34589696
复制相似问题