Whenever a stone does not update crontab tasks

I use whenever a gem on my 2+ year old slice in Slicehost. However, I cannot do the same on my new fragment.

The main differences are that I now run RVM on both my MBP and slice. I also run Rails 3. I have Rubygems v 1.5.0 and the latest versions of RVM, Ruby 1.9.2p136, Capistrano and all other packages there.

I tried a million things, read all the docs, and for now I use whenever gem version 0.6.2. I also covered all questions on relevant topics on SO, as well as on Google.

Here is the code in deploy.rb:

namespace :deploy do ... desc "Update the crontab file" task :update_crontab, :roles => :db do run "cd #{release_path} && whenever --update-crontab #{application}" end end after 'deploy:update_code', 'deploy:update_crontab' 

Here is the error message that I get after running 'cap deploy'

 failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.2' -c 'cd /home/deploy/public_html/lasource/releases/20110209201551 && /home/deploy/.rvm/gems/ruby-1.9.2-p136/bin/whenever --write-crontab'" on lasource.ohlalaweb.com 

Any suggestions would be welcome.

By the way, where are the kapistran magazines?

By adding "bundle exec" thanks to the Simone proposal, I was able to complete the header deployment procedure, as everything went well. However, a new problem is that my crontab file is still empty of tasks and has not created my partition with its 4 tasks.

+4
source share
2 answers

If you are using Rails 3, be sure to run the command with bundle exec .

 namespace :deploy do desc "Update the crontab file" task :update_crontab, :roles => :app, :except => { :no_release => true } do run "cd #{release_path} && bundle exec whenever --update-crontab #{application}" end end 
+10
source

According to README:

If a :path is not set it will default to the directory in which whenever was executed.

Therefore, you do not need to burn a CD to a folder. Also, have you tried other ways to invoke a shell command? I use backticks and it works in my env

 namespace :deploy do desc "Update the crontab file" task update_crontab: :environment do `whenever -i cellar` end end 
0
source

Source: https://habr.com/ru/post/1339085/


All Articles