我有一个 Rails 应用程序,在 EC2 实例(Ubuntu 发行版)上运行。
问题是 CRON 任务从未运行过——这就是问题所在。他们在本地工作,但不在 Amazon EC2 上(可能是因为 ruby 的路径不正确等 - 但不幸的是我在这方面不是很熟练)。如何使用 Rails 应用程序 (RVM) 运行 CRON 任务?
我正在解决这个问题的第三天,但仍然无法使其正常工作,所以我将非常感谢每一个帮助。
谢谢
编辑:
crontab -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$
日程安排.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