1

I need to set the environment for my whenever scheduler to all environment (production, staging & development)

I need this because I want the cron to trigger on any given environment.

I know I can set the environment as follow:

set :environment, 'staging'

or

set :environment, 'development'

etc

But any of these will only default the environment to the specified.

How can I set the environment to be all so as for it to work for all scenario?

Thanks.

x6iae
  • 4,074
  • 3
  • 29
  • 50

1 Answers1

0

While deploying you can set the environment like this in your deploy.rb file bundle exec whenever --update-crontab --set 'environment=#{rails_env}&path=#{deploy_to}/current/'.

Praveen Dhawan
  • 300
  • 4
  • 9