ruby 上 rails 如何激活 cronjobs?
ruby on rails how to activate cronjobs?
我的 ruby 上的 rails 应用程序中有一些 cronjobs 随时间生成。我怎样才能激活它们?目前他们没有 运行 而我 rails s
.
更新
每当我执行 -w 时出现此错误:
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not findbundler (>= 0) amongst [actionmailer-4.2.1, actionpack-4.2.1, actionview-4.2.1, activejob-4.2.1, activesupport-4.2.1, builder-3.2.2, bundler-unload-1.0.2, daemon-1.2.0, erubis-2.7.0, executable-hooks-1.3.2, gem-wrappers-1.2.7, globalid-0.3.3, i18n-0.7.0, loofah-2.0.1, mail-2.6.3, metaclass-0.0.4, mime-types-2.4.3, mini_portile-0.6.2, minitest-5.5.1, mocha-1.1.0, nokogiri-1.6.6.2, rack-1.6.0, rack-test-0.6.3, rails-deprecated_sanitizer-1.0.3, rails-dom-testing-1.0.6, rails-html-sanitizer-1.0.2, rubygems-bundler-1.4.4, rvm-1.11.3.9, thread_safe-0.3.5, tzinfo-1.2.2] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/bundle:22:in `<main>'
使用whenever
命令。这会将 config/schedule.rb 中定义的作业写入您的 crontab:
whenever -w
要从您的 crontab 中清除作业:
whenever -c
我的 ruby 上的 rails 应用程序中有一些 cronjobs 随时间生成。我怎样才能激活它们?目前他们没有 运行 而我 rails s
.
更新
每当我执行 -w 时出现此错误:
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not findbundler (>= 0) amongst [actionmailer-4.2.1, actionpack-4.2.1, actionview-4.2.1, activejob-4.2.1, activesupport-4.2.1, builder-3.2.2, bundler-unload-1.0.2, daemon-1.2.0, erubis-2.7.0, executable-hooks-1.3.2, gem-wrappers-1.2.7, globalid-0.3.3, i18n-0.7.0, loofah-2.0.1, mail-2.6.3, metaclass-0.0.4, mime-types-2.4.3, mini_portile-0.6.2, minitest-5.5.1, mocha-1.1.0, nokogiri-1.6.6.2, rack-1.6.0, rack-test-0.6.3, rails-deprecated_sanitizer-1.0.3, rails-dom-testing-1.0.6, rails-html-sanitizer-1.0.2, rubygems-bundler-1.4.4, rvm-1.11.3.9, thread_safe-0.3.5, tzinfo-1.2.2] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/bundle:22:in `<main>'
使用whenever
命令。这会将 config/schedule.rb 中定义的作业写入您的 crontab:
whenever -w
要从您的 crontab 中清除作业:
whenever -c