Запуск Rake-задачи с тактовым процессом

В моем приложении Heroku у меня есть процесс clock, который должен периодически выполнять задачу rake. Я использую gem clockwork. Вот код в lib/clock.rb:

require File.expand_path('../../config/boot',        __FILE__)
require File.expand_path('../../config/environment', __FILE__)
require 'clockwork'

include Clockwork

every(1.day, 'API Data Fetching', :at => '18:31') { `rake build_index` }

Вот фрагмент журнала Heroku:

2013-07-15T18:31:00.716092+00:00 app[clock.1]: I, [2013-07-15T18:31:00.673880 #2]  INFO -- : Triggering 'API Data Fetching'
2013-07-15T18:31:39.131681+00:00 app[clock.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
2013-07-15T18:31:39.132841+00:00 app[clock.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
2013-07-15T18:31:39.132346+00:00 app[clock.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)

Задача не выполняется и данные API не извлекаются. В чем может быть проблема? Является ли выполнение задачи rake из clock.rb плохой идеей?

1 ответ

Ответьте через долгое время:) но вам нужно добавить Procfile для работы часового гемора с герою, этот вопрос может вам помочь.

Другие вопросы по тегам