2013-10-01 2 views
0

У меня есть приложение Rails, работающее на экземпляре EC2 (дистрибутив Ubuntu).Amazon EC2 не знает о заданиях CRON

Дело в том, что задачи CRON никогда не запускаются - вот в чем проблема. Они работают локально, но не на Amazon EC2 (вероятно, из-за неправильных путей к рубину и т. Д.), Но, к сожалению, я не очень квалифицирован в этой области). Как запустить CRON-задачи с помощью Rails-приложения (RVM)?

Я борюсь на третий день с этой проблемой, но все равно не могу заставить ее работать, поэтому я буду очень благодарен за любую помощь.

Спасибо

EDIT:

кронтаб -e

# Begin Whenever generated tasks for: /home/user_name/project/releases/201309301$ 
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /home/user_name/f$ 

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /home/user_name/f$ 


# End Whenever generated tasks for: /home/user_name/project/releases/20130930170$ 

schedule.rb

set :output, "/home/user_name/project/current/log/cron_log.log" 
every 5.minutes do 
    puts "It's working !!!" 
    runner "User.grab_first_user!", :environment => 'production' 
end 

cron_log.log

: No such file or directory 
.... 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby/bin/bash: bundle: command not found 
: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory/bin/bash: /usr/bin/some_great_command: No such file or directory 

/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby/bin/bash: bundle: command not found 
: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
: No such file or directory 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
/bin/bash: bundle: command not found 
/usr/bin/env: ruby: No such file or directory 
/usr/bin/env: ruby: No such file or directory 
/bin/bash: bundle: command not found 
/bin/bash: /usr/bin/some_great_command: No such file or directory 
+0

Итак, что находится в вашем файле 'crontab' и почему вы думаете, что у него неправильный путь к рубину? –

+0

'Евгений, я обновил ответ, спасибо. – user984621

+0

Не могли бы вы запустить 'which ruby' в консоли и что это такое? –

ответ

0

Лучшее решение для этого я нашел использовать «при» драгоценный камень, который позволяет определить задачи в приложении, а затем, если вы используете capistrano для развертывания, он может автоматически обновлять задачи cron на сервере. Если вы не используете Capistrano, вы можете использовать командную строку на сервере для создания заданий.

Когда: https://github.com/javan/whenever

Использование Capistrano с Всякий раз, также описано там.

+0

Я использую жемчужину' Everyever', но он просто не работает на сервере - возможно, из-за неправильных путей рубин или что-то в этом роде. – user984621

1

Вы должны использовать абсолютные пути в cron. Существует возможность определить переменную PATH в cron, которая будет доступна для всех ваших заданий cron. Просмотрите документацию cron.

Вы также можете использовать опции -l с bash для вызова bash в качестве оболочки alogin (что означает, что он устанавливает среду на основе вашего .bashrc и т. Д.). Смотрите пример команды ниже

"/bin/bash -l -c 'cd /project/folder; RAILS_ENV=production /usr/bin/bundle exec rails runner ./script/monthly.rb >> ./cron_log 2>&1'"  

Поскольку вы используете whenever, которые вы определили job_type в вашем schedule.rb правильно? что-то вроде этого...

job_type :rake, "cd :path && RAILS_ENV=:environment bundle exec rake :task --silent :output" 
job_type :runner, "cd :path && RAILS_ENV=:environment bundle exec rails runner :task :output" 

Также установите выход, так что все выходные с хрон рабочих мест фиксируется в файле для вас, чтобы проверить

set :output, "/home/project/log/cron_log.log" 

тогда Вы должны быть в состоянии определить такие задачи, как это

every :day, :at => '12:01am' do 
    rake "ts:index" 
end 

every :month, :at => '05:10am' do 
    runner 'script/monthly_job.rb' 
end 

every :saturday, :at => "2:00am" do 
    command "/home/project/scripts/clean_stale_users.sh" 
end 

Обновление:

если используется rvm, выполните следующие действия: rvm integration with cron

+0

Привет, 'Eternal-Learner', да, я использовал абсолютные пути, задачи также должны быть правильно определены ... Я также добавил журналы (я обновил OP). благодаря – user984621

Смежные вопросы