1. chintan

    cant you use bundle exec such as :

    run “cd #{release_path}; bundle exec whenever –set environment=#{@rails_env}; bundle exec whenever –update-crontab ‘yourAppNameHere'”

    with bundle exec there is no need for step 1) install gem whenever

  2. admin

    Sure you can… but since using custom chef is a better option here (for engine yard) I updated the post to advise using that instead.

    Always more than one way to do it.

  3. Desi McAdam

    Hi Sara, Thanks for the post. Secondary note for your readers just in case they need a reminder. If you only want this to run on a util server be sure to wrap the above deploy hook stuff with current_role == ‘util’.

    Cheers and Thanks again.

  4. first of all, thanks for this – helped sort my crontab/whenever problems out. secondly – chintan is correct above – you shouldn’t be installing any gems on your EY instances even in a chef recipe.

    Using bundle exec means you’ll get the version of whenever you have bundled with your app and is the correct way to solve this problem.


  5. saratrice

    Thanks, Nic. I’ve updated the post entirely to account for all the new info I’ve learned since Sep 2011.

  6. Chintan

    Thanks for the update….Here is my deploy hook (that works) on ey solo instance for reference:

    In before_restart.rb:

    @rails_env = node[:environment][:framework_env]
    run “cd #{release_path}; bundle exec whenever –set environment=#{@rails_env} –update-crontab fleetapp”

    Also, as pointed out be sure to wrap this in current_role == ‘util’ stuff for a cluster setup.


Leave a Reply

Your email address will not be published. Required fields are marked *