0
我是個嘗試添加Whenever gem我的Rails項目,我添加了寶石的Gemfile中Capistrano的+每當寶石:無法部署。「只要是不包的一部分將它添加到Gemfile中」
gem "whenever", "~> 0.8.4"
並且安裝沒有任何問題。 然後,我添加了一個簡單的任務到生成schedule.rb
文件:
set :output, "/home/my_deploy_name/project_name/current/log/cron_log.log"
every 2.minutes do
command "/usr/bin/some_great_command"
runner "MyModel.some_method"
rake "some:great:rake:task"
puts "It's working !!!"
end
,然後我添加以下到deploy.rb
文件:
set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"
namespace :deploy do
desc "Update the crontab file"
task :update_crontab, :roles => :db do
run "cd #{latest_release} && whenever --update-crontab #{application}"
end
end
我試圖建立latest_release
,current_path
和release_path
,但在所有情況下總是相同的輸出:
*** [err :: IP] sh: 1:
*** [err :: IP] whenever: not found
*** [err :: IP]
...
*** [err :: 54.221.241.111] /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem'
*** [err :: IP] :
*** [err :: IP] whenever is not part of the bundle. Add it to Gemfile.
*** [err :: IP] (
*** [err :: IP] Gem::LoadError
*** [err :: IP])
*** [err :: IP] from /home/my_deploy_name/project_name/shared/bundle/ruby/2.0.0/bin/whenever:22:in `<main>'
何要解決這個問題? (我部署到Amazon EC2上 - Ubuntu的)
感謝